InputTextArea and Enter key

UI Components for JSF
Post Reply
jmflores
Posts: 4
Joined: 26 Aug 2016, 07:45
Contact:

23 Jan 2017, 14:28

Hello, I have developed my composite inputTextarea and I'm having strange behaviour. My inputTextarea have other component that allow us navigate between others controls when users press Enter key. Many times this works fine but sometimes Enter key produce a line break in the inputTextarea component. I know that normal behaviour it's insert line break when somebody press enter key but why the behaviour isn't always the same? (always line break or always jump to the next component). To jump to other component I use a JQuery file called navigationControl.js and when I debug my code, if Enter key produce a line break in the inputTextarea the code flow never use navigationControl.js. Somebody can tell me why this behaviour?.

My composite inputTextarea:

Code: Select all

...
<composite:implementation>   
		<ui:decorate template="/WEB-INF/templates/cc/inputForm.xhtml">
			<ui:param name="msgTypes" value="#{cc.attrs.msgTypesError}"/>
			<ui:define name="inputForm">
			
			<p:inputTextarea id="input" immediate="#{cc.attrs.inmediate}" value="#{cc.attrs.bean[cc.attrs.property]}" 
				        tabindex="#{groupOfControl.getNextIndex(cc)}" maxlength="#{cc.attrs.maxLength}" 
				        disabled="#{cc.attrs.disabled}" binding="#{cc.attrs.binding}" 
				        required="#{cc.attrs.require}" styleClass="#{cc.attrs.styleClass}" 
					rows="#{cc.attrs.row}" cols="#{cc.attrs.cols}" autoResize="#{cc.attrs.autoResize}" widgetVar="#{cc.clientId}Var"
					style="width:#{cc.attrs.width}%;resize:none">

				<composite:insertChildren />		
			</p:inputTextarea>
				
			<myComponent-ui:navigationControl id="navigationControl" for="input" previous="#{cc.attrs.previousComponent}" 
				next="#{cc.attrs.nextComponent}" process="input @this"
				update="@this:input @this #{cc.attrs.activateEventoChange ? cc.attrs.update: ''}">
			</myComponent-ui:controlnavegacion>
			
		</ui:define>
	</ui:decorate>   
	</composite:implementation>
The main idea is navigate between controls using the Enter key and when users press CTRL + Enter key, if they are in inputTextarea produce the line break. But first I need that Enter key always do the same when the focus is on inputTextarea.

Regards.
Primefaces version: 5.3 - Modena Theme
JSF version: 2.2.13
Tomcat 8

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests