• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamic selectOneMenu

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pls help me how to write dynamic selectOneMenu in backingBean
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Populating country field for example

<h:selectOneMenu>
<f:selectItemsValue="#{managedbean.country}"/>
</h:seleOneMenu>

In your managedbean
----------------------

public SelectItem[] country=
{ new SelectItem(new Integer(1),"India"}
new SelectItem(new Integer(2),"Pakistan"}
new SelectItem(new Integer(3),"Bangladesh"}
};

public SelectItem[] getCountry()
{
return country;
}

Thats all.Hope this will work for you.
 
Bhaskar GR
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Iam asking without writing jsp code,i have to write
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic