I would just make the enum like....
public enum Flower {
Black(0), Red(1);
private int id;
Flower(int id) {
this.id = id;
}
public int getId() { return this.id; }
}
Then do what you want with it in your action. I would use the default
converter to get yourself the enum in your action. Then user the
.getId() to get the ordinal value.
On Mon, Aug 3, 2009 at 2:46 PM,
massive.boisson<[email protected]> wrote:
>
> 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