• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Mutiple ComboBoxes using c:forEach

 
Greenhorn
Posts: 17
Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to create mutiple ComboBoxes from a Map containing label for the box as key and an object having [possible values, selected value] as Value (id=bundleItemDecoration).
This map is updated on value change of another ComboBox (id=bundleType).
Code works fine when rendered for the first time, but behaves wierd when re-rendered.
When I change the value in ComboBox (id=bundleType), Map is updated and labels (id=bundleItemDecoration) are displayed correctly on the Page but possible values in their corresponding ComboBoxes (id=bundleItemDecoration) are not changed.
Please help.

 
Saloon Keeper
Posts: 26267
186
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
Sorry, "Invincible Virus", you've been Detected.

We don't have many rules here at the JavaRanch, but we do insist that you use your Real Name and not some sort of "handle" or obvious alias. If you're not sure about this, see
http://www.javaranch.com/name.jsp .

Normally I don't offer advice until after people have cleaned up their act, but I will say one thing in the mean time: DON'T use JSTL with JSF. It doesn't work very well, and there's nothing JSTL can do that straight JSF can't do.
 
SaurabhRc Jain
Greenhorn
Posts: 17
Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue is now solved. Rootcause was the usage of Map to hold the data.
Combobox once rendered on the UI keeps refering to same data pointer e.g.

or

will keep on pointing to the soSuggestionList of same key in the HashMap even if c:forEach has rerendered the UI component.

Solution is to use List instead of map. On re-rendering the UI component, we will actually change the binding data to the suggestionValues property of rich:comboBox.

Final working piece of code (with few more modifications) -




P.S. Thanks to Peter for the help.
http://community.jboss.org/thread/174919?tstart=0
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:DON'T use JSTL with JSF. It doesn't work very well, and there's nothing JSTL can do that straight JSF can't do.


Indeed. I involved a JSF project 4 months back... and i noticed this...
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic