You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lally Singh <la...@gmail.com> on 2007/06/12 22:00:43 UTC

Re: [S2] Form & OGNL Questio

Well, I was simplifying a bit.

it's actually survey.responseGroups[#i], where getResponseGroups()
returns a List<Response>, each of which has a getValue(Long) and
setValue(Long).

Hmm, setResponseGroups() wants a full List back, would that mess things up?

On 6/12/07, Dave Newton <ne...@yahoo.com> wrote:
> --- Lally Singh <la...@gmail.com> wrote:
> > <s:set name="i" value="0" />
> > <s:iterator value="groups">
> >   <s:radio name="groups[#i].value" list="{1,2,3,4}"
> > />
> >   <s:set name="i" value="#i + 1" />
> > </s:iterator>
> >
> > This doesn't do what I want, which is to have 1 set
> > of radio buttons per item in groups, each bound to
> > the value property of element i in groups.
>
> How is "groups" defined in your Action and what do its
> get/set look like? (And as a sanity check, is it
> generating the appropriate HTML?)
>
> FYI, you can skip the <s:set.../> by using
> <s:iterator.../>'s "status" attribute.
>
> d.
>
>
>
>
> ____________________________________________________________________________________
> Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
> http://autos.yahoo.com/carfinder/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
H. Lally Singh
Ph.D. Candidate, Computer Science
Virginia Tech

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Form & OGNL Questi

Posted by Lally Singh <la...@gmail.com>.
Actually:
<s:radio name="survey.responseGroups[%{#i}].value" list="{1,2,3,4}" />

Otherwise all the radio boxes have exactly the same name, and that
leaves me with a single choice in a large matrix of options, instead
of 1 choice per group of 4.

While I do end up writing the group of Responses to the DB, they all
have their default (null) values.



On 6/12/07, Dave Newton <ne...@yahoo.com> wrote:
> --- Lally Singh <la...@gmail.com> wrote:
> > Well, I was simplifying a bit.
> >
> > it's actually survey.responseGroups[#i], where
> > getResponseGroups() returns a List<Response>, each
> of
> > which has a getValue(Long) and setValue(Long).
> >
> > Hmm, setResponseGroups() wants a full List back,
> > would that mess things up?
>
> Shouldn't... I think.
>
> So is your JSP actually:
>
> > <s:radio name="survey.responseGroups[#i].value"
> >          list="{1,2,3,4}"/>
>
> d.
>
>
>
>       ____________________________________________________________________________________
> Luggage? GPS? Comic books?
> Check out fitting gifts for grads at Yahoo! Search
> http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
H. Lally Singh
Ph.D. Candidate, Computer Science
Virginia Tech

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Form & OGNL Questio

Posted by Dave Newton <ne...@yahoo.com>.
--- Lally Singh <la...@gmail.com> wrote:
> Well, I was simplifying a bit.
> 
> it's actually survey.responseGroups[#i], where
> getResponseGroups() returns a List<Response>, each
of
> which has a getValue(Long) and setValue(Long).
> 
> Hmm, setResponseGroups() wants a full List back,
> would that mess things up?

Shouldn't... I think.

So is your JSP actually:

> <s:radio name="survey.responseGroups[#i].value"
>          list="{1,2,3,4}"/>

d.



      ____________________________________________________________________________________
Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org