File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Ajax implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Ajax implementation" Watch "Ajax implementation" New topic

Ajax implementation

Popescu Ion
Ranch Hand

Joined: Jan 14, 2011
Posts: 33
Hi guys,
Have this JSF page (index.xhtml) :

the bean file :

and the faces-config.xml file :

After I'm selecting the category of the oneMenu component and hitting the button, in the listBox are displayed the respective content. How can I do that with Ajax, using <f:ajax> tag, and if it's possible without either hitting that button, just selecting category. Any help will be appreciated. Thanks in advance.

Sorry for my English, it is not my first language.
Andy Spring

Joined: Mar 31, 2011
Posts: 1

Hi there

Try this modified code below.
You can remove the navigation rule from your faces-config.xml, unless you still require the commandButton redirect.
The key is the Ajax tag and some changes to the bean ...

New index.xhtml :

The new Test.bean :

Hope this helps

Tested on NetBeans, GlassFish 3.1, Chrome, FireFox
It is sorta covered in the JavaRanch Style Guide.
subject: Ajax implementation
Similar Threads
Birth Date nightmare - passing variable between beans and java objects
File upload
Navigation problem
Can't get JSF selectOneMenu to show list of items
faces-config not working