Messages posted by: liviasilvasantos  XML
Profile for liviasilvasantos -> Messages posted by liviasilvasantos [3]
Author Message

I was trying to use ice:inputtext and f:ajax event="blur" but it only worked with partialSubmit. Now I tried h:inputtext and f:ajax event="blur".

Sometimes it works just fine although more than one request is executed.
Example: if I hit Enter inside a h:inputtext, it passes 2 or 3 times through valuechangelistener method.

The valuechangelistener method adds a new line to listaEE attribute. So after all requests processed, I get 2 or 3 new lines (and all I need is one).

In other hand, on blur event and using h:inputtext and f:ajax, it worked correctly.

I believe the main problem is still the same: when I hit Enter, I can't control how many times valuechangelistener method is called.

Thank you, Philip!

Hi Philip,

I had some tests yesterday and what I assume:

-f:ajax and ace:ajax on icefaces 3.1.0 seems useless since partialSubmit is required anyway
-actionListener on an inputtext field works ok, but in my case, that I need to handle both onblur and onkeyup (code 13 for enter), gets overriden by valuechangelistener
-icefaces adds automaticaly an annoying onkeyup event that make a full submit

Anyway, here is my xhtml:

 <!--other inputtexts and selects up here-->
 <ace:dataTable id="eeTable" var="item" rowIndexVar="row" value="#{MBean.listaEE}" paginator="false">
 	<ace:column headerText="#{cat['numcol']}" id="numEECol" style="width: 10%">
 		<ice:inputText id="numEE" partialSubmit="true" immediate="true" styleClass="c70 mask-ee"
 			valueChangeListener="#{MBean.searchEE}" value="#{item.num}">
 			<f:attribute name="item" value="#{item}"/>
 					jQuery(".mask-ee").mask("9999-99", {placeholder: "0", autofilling: true});
 	<ace:column headerText="desccol" id="descCol">
 		<ice:outputText value="#{item.desc}"/>
 	<ace:column headerText="#{cat['principalcol']}" id="principalEE" style="width: 16%">
 			<ice:selectOneRadio id="princiapalrdo" partialSubmit="true" immediate="true" 
 				valueChangeListener="#{MBean.selectPrincipal}" value="#{item.principal}">
 				<f:attribute name="item" value="#{item}"/>
 				<f:selectItem itemLabel="" itemValue="true" />
 	<ace:column headerText="" id="btnEE" style="width: 15%">
 		<ice:commandButton  id="addEEButtonTable" title="#{app['commandButton.add']}" 
 			action="#{MBean.addEE}" immediate="true"  partialSubmit="true">
 		<ice:commandButton id="removeEEButtonTable" title="#{app['commandButton.remove']}" 
 			actionListener="#{MBean.removeEE}" immediate="true"  partialSubmit="true">
 			<f:attribute name="item" value="#{item}"/>
 <!--button Save down here-->

I have this form with an inputtext that should handle both onblur event and enter key pressed.

I handle onblur event by adding partialSubmit=true and valuechangelistener inputtext's property and it works fine.

On the other hand, if I press enter key at the same inputtext element, it looks like I'm getting two or more requests to the Managed Bean. So the first time it enter valuechangelistener and I put a message add faces context. But the others requests seems to erase that message somehow.

So my question is: is it possible to handle both blur and enter key pressed and make it work correctly? If not, is there a way to prevent enter key (I tried javascript but it always sends a request)?

Is it possible to use f:ajax in Ice faces? Do I really need to use partialSubmit?

By the way, I'm using Ice Faces 3.1.0 and JSF Mojarra 2.1.19.
Profile for liviasilvasantos -> Messages posted by liviasilvasantos [3]
Go to:   
Powered by JForum 2.1.7ice © JForum Team