Page 1 of 1

<f:ajax> not working in IE8/7

Posted: 20 Oct 2011, 19:55
by dreddy
Hi All.. Please help

I have code like shown below for calling a java bean method using f:ajax call.

<h:selectOneMenu id="Cat" value="#{bean.selectedCategory}" >
<f:ajax action="change" listener="#{bean.changeMethod}" update="grid" render="grid"></f:ajax>
<f:selectItems value="#{data.categories}" itemValue="#{data.categories}"/>
</h:selectOneMenu>

java bean listener as implemented as below

public void changeCat(AjaxBehaviorEvent e) {
String newValue = getSelectedCategory();
// some logic here
}

in above case, for netscape, newValue is getting value from value="#{bean.selectedCategory}". But IE8/7 newValue is "". (the value not being set to #{bean.selectedCategory} though the setter method is called.)

Kindly let me know how to proceed

Re: <f:ajax> not working in IE8/7

Posted: 21 Oct 2011, 10:14
by Oleg
Wrong place for you in this forum. I can't see any PrimeFaces components in your code at all.

Re: <f:ajax> not working in IE8/7

Posted: 21 Oct 2011, 10:44
by Matrium
are you sure you want to use "update" -Attribute in JSF2-ajax-tag?

Maybe i am wrong, but i thought it was like this:

JSF2
<f:ajax listener="#{bean.listenerMethod}" execute="comp_id" render="comp_id" />

Primefaces
<p:ajax listener="#{bean.listenerMethod}" process="comp_id" update="comp_id" />


also i am not sure if you use <f:selectItems> correctly. Try setting var="var" and using that in the itemLabel instead

in my case i use <h:selectOneMenu, but with <p:ajax and it works like a charm