This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSF and the fly likes Default value for a selectOneListbox Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Default value for a selectOneListbox
 
Similar Threads
Problem using valueChangeListener and onchange
Newbie selectOneListBox question
Problem with submit()
Problem to populate a selectOneListbox from a Java-Bean
Create a Different selectOneListbox Depending On the Radio Button Clicked