<f:ajax> not working in IE8/7

UI Components for JSF
Post Reply
dreddy
Posts: 6
Joined: 19 Oct 2011, 19:39

20 Oct 2011, 19:55

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

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

21 Oct 2011, 10:14

Wrong place for you in this forum. I can't see any PrimeFaces components in your code at all.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Matrium
Posts: 112
Joined: 16 May 2011, 08:27

21 Oct 2011, 10:44

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
PrimeFaces (Elite) 4.0.13, Majorra 2.1.28, Tomcat 7.0.53
Testing with Firefox, Chrome and IE9+IE10
<3 Primefaces!!!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests