hello matthias,
my previous message consists of two independent parts:
@unselectedLabel
and
@dynamic items
within "@dynamic items" i just provided the sample source code to solve the
problem of stephen (the question concerning dynamic items).
-> the sample source code is not connected with the scenario i mentioned
within "@unselectedLabel" (the "discard"-topic).
regards,
gerhard
2007/12/12, Luka Surija <[EMAIL PROTECTED]>:
>
> I think that this is a good behavior. If there is no unselectedLabel,
> then component works as you expected.
>
> Why do you think that isn't an expected behavior?
>
> Regards,
> Luka
>
> Matthias Wessendorf wrote:
> > this sounds odd to me as well.
> >
> > I would expect, the unselectedLabel goes away, once there was a
> selection.
> >
> > Do you mind to file a bug for this?
> >
> > -M
> >
> > On Dec 12, 2007 12:21 PM, Stephen Friedrich <[EMAIL PROTECTED]>
> wrote:
> >
> >> Thanks for the answer.
> >> So basically you are saying I can't use
> >> <tr:selectOneChoice unselectedLabel="Please choose" ...> for this?!
> >> As you suggested I can "fake" that label myself, but I wonder what's
> the
> >> purpose of the trinidad attribute if it does not do this automatically.
> >> Part of the problem is that my select items are not hardcoded (are they
> ever
> >> in real apps?), but based on a query. So I would have to wrap that
> query in
> >> my backing bean to dynamically add/remove the unselected label. If I do
> that
> >> I have to stop using entites (which are automatically converted to
> select
> >> items by seam's s:selectItems), but will have to explicitly create
> >> SelectItems. Quite a mess for such a simple feature.
> >>
> >> The current behaviour seems like a bug to me.
> >> Why the heck does trinidad show an "unselected label" if there actually
> _is_
> >> a selection?
> >>
> >>
> >>
> >> 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 < [EMAIL PROTECTED]>:
> >> 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
> >>
> >
> >
> >
> >
>
>
> --
> Luka Ĺ urija
> [EMAIL PROTECTED]
> +385 98 434 061
>
> I.Y. tim d.o.o.
> www.iytim.hr
> [EMAIL PROTECTED]
>
>
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces