myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Petracek" <>
Subject Re: [Trinidad] selectOneChoice: Make "unselectedLabel" item go away after selection?
Date Wed, 12 Dec 2007 10:58:32 GMT

just a sample source code:

<tr:selectOneChoice id="selectOne" value="0" valueChangeListener="#{
bean.change}" autoSubmit="true" partialTriggers="selectOne"
   <tr:selectItem label="Please choose" value="0"
   <tr:selectItem label="one" value="1"/>
   <tr:selectItem label="two" value="2"/>

within the bean:

private boolean valueSelected;

public boolean isValueSelected()
    return valueSelected;

public void setValueSelected(boolean valueSelected)
    this.valueSelected = valueSelected;

public void change(ValueChangeEvent event)
    setValueSelected( true );


2007/12/12, Stephen Friedrich <>:
> I like to show "Please choose" in a selectOneChoice as long as no
> option has been selected, yet.
> As soon as the user selects one of the items the label should vanish
> from the list.
> (autoSubmit is set and the selectOneChoice is partialTrigger for itself.)
> It really doesn't make any sense to select "Please choose" from
> the list after having already selected something for real.


Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

View raw message