This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Populating combo box with xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Populating combo box with xml file " Watch "Populating combo box with xml file " New topic
Author

Populating combo box with xml file

Nipun Bahr
Ranch Hand

Joined: Jul 09, 2008
Posts: 55

Hi All,

How can I populate combo box in JSF with xml file contents?

I am using Icefaces on top of JSF 1.2
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

the ice:selectOneMenu is populated by an ArrayList of list items. You can see an example of in the Component Showcase on the ICEsoft website.

To populate that list you don't need any special JSF functionality. Just parse the XML file using whatever XML parser you like to add the data elements to the ArrayList. That list is assigned to the ice:selectOneMenu control in your view.
 
 
subject: Populating combo box with xml file
 
Similar Threads
use AJAX to save data
combo box valildations
Separator in combo box
Handling Chinese characters while retriving fromDB using JDBC
how to clear the values of components on validation errors in JSF