Hi,

Try to create a converter/formatter for your enum and make sure it is in found 
by Stripes. Then you can convert/format your enum with ordinal instead of name.

Christian

-----Original Message-----
From: massive.boisson [mailto:[email protected]]
Sent: Monday, August 03, 2009 4:47 PM
To: [email protected]
Subject: Re: [Stripes-users] stripes:options-enumeration


Hi, I am not sure I follow what you suggested. No matter what I try, the end 
result is that the value attribute of option tag that is rendered in HTML is 
whatever enum attribute points to.

As example, i have
public enum Flower {
    Black,      // 0
    Red,          // 1
    Green,        // 2
    Purple        // 3
}

and
<stripes:options-enumeration enum="com.garden.Flower"/> will yield <option 
value="Red">Red</option> etc

What I want is
<option value="1">Red</option>

and without changing actual values of the Enum class (which are used throughout 
the code).

Thanks for help,
--MB



nmaves wrote:
>
> make that ordinal value part of the enum itself.  Then you can use it
> in the tag.
>
>> The issue I have when using options-enumeration tag is that both
>> value and label are the same. The way to change that (with label
>> attribute) do not seem to be suitable for me.
>> What I would like is to have value of option tag to be ordinal (0, 1,
>> 2, etc ) and label actual enum value.
>
--
View this message in context: 
http://www.nabble.com/stripes%3Aoptions-enumeration-tp24792797p24797507.html
Sent from the stripes-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with Crystal 
Reports now.  http://p.sf.net/sfu/bobj-july 
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to