myfaces-users mailing list archives

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

just a sample source code:

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


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 );
}

regards,
gerhard



2007/12/12, Stephen Friedrich <trinidad@eekboom.com>:
>
> 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.
>



-- 

http://www.irian.at

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

Professional Support for Apache MyFaces

Mime
View raw message