aspose file tools*
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
Author

Dynamic selectOneMenu

Bhaskar GR
Greenhorn

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

<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

Joined: Jun 13, 2008
Posts: 28
Iam asking without writing jsp code,i have to write
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic selectOneMenu