Perhaps there are better ways, but this is how I do it:
<h:selectOneMenu id="userChooser" title="#
{labels.usrMgt_userChooserHelp}" valueChangeListener="#
{managerbean.chooseUserTrigger}"
disabled="#{managerbean.usersdisabled }"
onchange="submit()" value="#{managerbean.currentUser.loginName}" >
<f:selectItem itemLabel="#{labels.usrMgt_chooseUsr}"
itemValue="choose_one"/>
<f:selectItems
value="#{managerbean.userKeyMap}"/>
</h:selectOneMenu>
As you can see, the first one ("f:selectItem" - without "S")is just
to return a default return value ("choose_one") which triggers a
customized error msg a valid usr should be chosen.
The real meat comes from the f:selectItemS where the actual values
are fetched.
As f:selectItem comes first, this is always shown first however.
Good luck,
Philippe
On 18 Feb 2006, at 19:27, Ing. Ricardo R. RamÃrez Valenzuela wrote:
I haven't found yet a way to do this, does this require a custom
component?
If I have a selectitem (si) and I give it values {a,b,c}, how do I make
it so none of them are selected on the first load of the page? I have
tried setting the value in the managed bean to null with no luck.