-
1. Re: Unable to make Ajax4JSF work (using NetBeans 6)
nbelaevski Feb 10, 2008 10:39 PM (in response to schinni) -
2. Re: Unable to make Ajax4JSF work (using NetBeans 6)
schinni Feb 11, 2008 12:32 AM (in response to schinni)Thanks so much for the prompt reply. It works now. The event name is case sensitive and woodstock uses different names from the norm.
-
3. Re: Unable to make Ajax4JSF work (using NetBeans 6)
schinni Feb 11, 2008 1:44 AM (in response to schinni)There seems to be a problem with the reRender logic. The action method is being called and the new options are being set to the Listbox lstTest2. However, the listbox does not display the new items. Any idea why this might be happening?
Thanks. -
4. Re: Unable to make Ajax4JSF work (using NetBeans 6)
viggo.navarsete Feb 11, 2008 2:20 AM (in response to schinni)schinni: Could you please post some more code from your jsp where you define your listbox? What is the id of the listbox?
-
5. Re: Unable to make Ajax4JSF work (using NetBeans 6)
schinni Feb 11, 2008 3:51 AM (in response to schinni)Hi,
The id of the listbox is lstTest2. The relevant JSP code is as follows:<webuijsf:listbox binding="#{Bean.lstTest2}" id="lstTest2" items="#{Bean.lstTest2DefaultOptions.options}" rows="8" selected="#{Bean.lstTest2DefaultOptions.selectedValue}" />
I retrieve the data required and insert it into the listbox lstTest2 like this in the action method (lstTest1_action):Option[] options = new Option[someList.size()]; for (int i = 0; i < someList.size(); i++) { String anItem = someList.get(i).toString(); options[ i ] = new Option(anItem, anItem); } this.getLstTest2DefaultOptions().setOptions(options);
I am at a loss as to why the lstTest2 listbox does not display the new data after this. -
6. Re: Unable to make Ajax4JSF work (using NetBeans 6)
viggo.navarsete Feb 11, 2008 5:03 AM (in response to schinni)what does your method return? A String, null, or something else? Remember, when you're dealing with AJAX requests, I think I've read somewhere that you must return null to make things work. Read more here: http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxAttributes.jsf?c=ajaxattributes
and especially this section:action method must return null if you want to have an Ajax Response with a partual page
update. This is regular mode called "Ajax request generates Ajax Response". In case of
action does not return null, but the action outcome that matches one of navigation rules, RichFaces
starts to work in "Ajax request generates Non-Ajax Response" mode.
I'm not sure if this was helpful, but you might try it, and look at the documentation that I provided as a URL. -
7. Re: Unable to make Ajax4JSF work (using NetBeans 6)
schinni Feb 11, 2008 12:18 PM (in response to schinni)My method returns a null. After this it flows through the init and the prerender functions of the same page's backing bean and then completes as normal. However the list box does not display the new data.
I tried changing my bean scope to session and then refreshed the page after the ajax request and then the listbox displayed the new data. So, the data is being set correctly.
So, there seems to be a problem in reRendering the listbox component upon completion of the action. The data is set but the listbox does not display the new data.