File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Dynamic selectOneMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Dynamic selectOneMenu" Watch "Dynamic selectOneMenu" New topic

Dynamic selectOneMenu

Bhaskar GR

Joined: Jun 13, 2008
Posts: 28
Pls help me how to write dynamic selectOneMenu in backingBean
Dishpal Bhaluja
Ranch Hand

Joined: Dec 30, 2007
Posts: 96
Populating country field for example


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

Joined: Jun 13, 2008
Posts: 28
Iam asking without writing jsp code,i have to write
I agree. Here's the link:
subject: Dynamic selectOneMenu
jQuery in Action, 3rd edition