File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Default value for a selectOneListbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Default value for a selectOneListbox" Watch "Default value for a selectOneListbox" New topic
Author

Default value for a selectOneListbox

Ian Dunsirn
Ranch Hand

Joined: May 25, 2006
Posts: 36
I have this listbox:

<h:selectOneListbox id="newStatus" size="1" value="#{thisIssue.status}">
<f:selectItems value="#{dropDown.statusList}"/>
</h:selectOneListbox>

What I would like is for the value to appear in the listbox to match what is in thisIssue.status. How can I do this because right now, I get the first value of dropDown.statusList instead of the value that is in thisIssue.status.

Am I missing something here?
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
Take the default value as the default value of your backing bean


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Default value for a selectOneListbox