a4j:support with h:selectOneMenu - works in IE, not in Firef
mgvarley Aug 29, 2008 8:56 AMHi all - I am having some problems with my search form and I think I have the narrowed the problem down to my use of the a4j:support tag. The action of my form is quite simple - display a dropdown list of countries as an h:selectOneMenu, user selects country, dropdown list of destinations is dynamically populated via an Ajax call to the session managed backing bean, user selects destination - clicks button and results (in this case vendors) matching the destination are displayed. (see code below)
This works absolutely fine with IE but with Firefox and Safari the value of the "destination" input is not being passed to the server the first time. However, once the empty results table is displayed along with the search controls and I try again it works. I have spent many hours debugging and scouring the web and still have no solution. If anyone has any idea what may be causing this I would be eternally grateful.
I am developing in Netbeans 6.1 with JDK1.6, JSF1.2 (Sun), RichFaces 3.2.1, IE 7.0, Firefox 3.0.1, Safari 3.1.2.
Thanks,
mark
private UIInput destinationInput; private UIInput countryInput; //... public void countryChanged(ActionEvent event) { getDestinationInput().resetValue(); fillDestinations(); } public void searchVendors(ActionEvent event) { try { setResults(vendorDAO.listByDestination(destinationID)); } catch (Exception e) { System.out.println(e.getMessage()); } } <rich:calendar id="arrivalDate" popup="true" boundaryDatesMode="scroll" value="#{searchBarBacking.arrivalDate}"/> <h:selectOneMenu id="country" binding="#{searchBarBacking.countryInput}"> <f:selectItem itemValue="Select a country...."/> <f:selectItems value="#{destinationsBacking.countries}"/> <a4j:support event="onchange" actionListener="#{searchBarBacking.countryChanged}" reRender="destination" ajaxSingle="true"/> </h:selectOneMenu> <h:selectOneMenu id="destination" binding="#{searchBarBacking.destinationInput}"> <f:selectItem itemValue="Select a destination...."/> <f:selectItems value="#{searchBarBacking.destinations}"/> </h:selectOneMenu> <h:commandButton value="#{msgs.header_button01}!" actionListener="#{searchBarBacking.searchVendors}" action="results"/>