Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

[S2] <s:select> and Integer lists

Lyallex

2008-09-05

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi

I have a form

It requires the user select year and month of birth

I have a little class Month that has getters and setters for monthNo
and monthName

This works perfectly when the months list is exposed to the ValueStack
in the action ( List<Month> months ...)

<s:select label="Month of birth" name="mob" list="months"
listKey="monthNo" listValue="monthName" required="true"/>

I also have a List of Integers, it's a configurable list loaded on the
fly so it's not fixed

it's exposed to the ValueStack in the action (List<Integer> years ...)
and I know it's populated and I want to do this

<s:select label="Year of birth" name="yob" list="years"
listKey="intValue" listValue="intValue" required="true"/>

but of course it doesn't work, I've tried all sorts of things without
luck (there is no 'getValue' or 'getIntValue' on Integer)
I'm thinking I may have to wrap the Integer to get this to work ...

is there a way to do this ???

many TIAs

Lyallex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.