Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Populating combo box with xml file

 
Nipun Bahr
Ranch Hand
Posts: 55
Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic