You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christoph Jaeger <ch...@derwald.at> on 2007/09/18 22:16:59 UTC
Select component with Enums
Using the select component with an Enum is very convenient:
...
<input t:type="Select" t:id="color" t:value="preferredColor"/>
...
to display a <input type="select" ...> html drop down list showing all
entries defined by the Enum Color.
Now I would like to have the same drop down list, only with an "- empty
-" entry as first entry (meaning: no color was selected,
preferredColor==null). Is there an easy way to define this (something like
<input t:type="Select" t:id="color" t:value="preferredColor"
t:empty="- empty -"/>
would be very nice), or do I have to manually create a SelectModel and
ValueEncoder?
Best Regards,
Christoph Jäger
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Select component with Enums
Posted by andyhot <an...@di.uoa.gr>.
Take a look at LabeledPropertySelectionModel of T4...
It can decorate every other Model - it simply adds an entry with a
configurable label on top.
Robin Helgelin wrote:
> On 9/18/07, Christoph Jaeger <ch...@derwald.at> wrote:
>
>> Now I would like to have the same drop down list, only with an "- empty
>> -" entry as first entry (meaning: no color was selected,
>> preferredColor==null). Is there an easy way to define this (something like
>>
>> <input t:type="Select" t:id="color" t:value="preferredColor"
>> t:empty="- empty -"/>
>>
>> would be very nice), or do I have to manually create a SelectModel and
>> ValueEncoder?
>>
>
> Add another entry to the enum that defines a non-selected state?
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Select component with Enums
Posted by Mark Stang <ms...@pingidentity.com>.
That was my solution, but then someone complained that it wasn't really a valid part of the list.
Mark J. Stang
Software Engineer
office: +1 303.468.2900
Ping Identity
-----Original Message-----
From: Robin Helgelin [mailto:lobbin@gmail.com]
Sent: Tue 9/18/2007 2:44 PM
To: Tapestry users
Subject: Re: Select component with Enums
On 9/18/07, Christoph Jaeger <ch...@derwald.at> wrote:
> Now I would like to have the same drop down list, only with an "- empty
> -" entry as first entry (meaning: no color was selected,
> preferredColor==null). Is there an easy way to define this (something like
>
> <input t:type="Select" t:id="color" t:value="preferredColor"
> t:empty="- empty -"/>
>
> would be very nice), or do I have to manually create a SelectModel and
> ValueEncoder?
Add another entry to the enum that defines a non-selected state?
--
regards,
Robin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Select component with Enums
Posted by Robin Helgelin <lo...@gmail.com>.
On 9/18/07, Christoph Jaeger <ch...@derwald.at> wrote:
> Now I would like to have the same drop down list, only with an "- empty
> -" entry as first entry (meaning: no color was selected,
> preferredColor==null). Is there an easy way to define this (something like
>
> <input t:type="Select" t:id="color" t:value="preferredColor"
> t:empty="- empty -"/>
>
> would be very nice), or do I have to manually create a SelectModel and
> ValueEncoder?
Add another entry to the enum that defines a non-selected state?
--
regards,
Robin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org