• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

selectOneMenu update from backing bean

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm very new in JSF development, so I'm hoping to get some pointers from you guys

I am currently developing a simple web application that displays a set of JSF components, some of them are custom JSF.

One of the components is a drop down list (I am using selectOneMenu component). I bind the value and the selectItems to my backing bean, as shown in the code below:


And in my backing bean, I have the following:
- String value;
- UISelectItems areaItems;
- and a method that fills up the content of the areaItems


The code works fine for the initial display. However, there is a custom JSF component on the page that displays an image and listens to user mouse event.
Upon mouse click, the listener (which is the backing bean) will be notified and the image being displayed will be updated.
Subsequently, the list of items displayed by the selectOneMenu needs to be updated as well (correspond to the new image).

How do I implement the refresh of selectItems in selectOneMenu upon an event received by another JSF component (and handled by the backing bean)?
Currently, upon mouse click, the image gets updated, but not the drop down menu, even though the areaItems object in the bean has been updated.

Any advise or pointers will be greatly appreciated. Thank you in advance.

 
Saloon Keeper
Posts: 25644
183
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably the easiest way is to use AJAX-enabled JSF components like those provided by JBoss RichFaces. The RichFaces controls support an attribute named "reRender" that tells what parts of the page should be updated.
 
clara irma
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for the suggestion! I will be looking into ajax4jsf for this.
reply
    Bookmark Topic Watch Topic
  • New Topic