struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Belingueres" <belingue...@gmail.com>
Subject Re: Passing a List through a hidden field
Date Thu, 24 Apr 2008 00:59:11 GMT
But it translates the List into a meaningful string because the
contents are Strings or Integers, but what about other objects that
doesn't override the toString() method?

Anyway, I suppose you could write a custom type converter for your
List, but I think the current multiple hidden fields solution is fine
too.

2008/4/23, Steve Akins <akinss@gmail.com>:
> Thanks Gabriel and Jeromy,
>
> I had thought of iterating through the List but was trying to avoid
> generating a mass of HTML hidden fields.
>
> I like it how the hidden tag translates the List into a meaningful
> String, it's just a shame that Struts/XWork doesn't handle it when the
> form is submitted.
>
> I have raised an Improvement request on the JIRA
> (https://issues.apache.org/struts/browse/WW-2612) and will continue to
> investigate a way around this.  If anyone else has some bright ideas
> it would be more than welcome.
>
> Regards,
> Steve
>
> On Wed, Apr 23, 2008 at 10:57 PM, Jeromy Evans
> <jeromy.evans@blueskyminds.com.au> wrote:
> >
> > Steve Akins wrote:
> >
> > > I have a List called "ids" which contains 4 Strings "22030", "6496",
> > > "6457", "6448"
> > >
> > > When the following tag is used:
> > > <s:hidden name="resend.ids" />
> > >
> > > It produces the following HTML:
> > >
> > > <input type="hidden" name="resend.ids" value="[22030, 6496, 6457,
> > > 6448]" id="/test/resend_resend_ids"/>
> > >
> > >
> > > When the form is submitted the "ids" List is populated with one String
> > > "[22030, 6496, 6457, 6448]" instead of 4 Strings "22030", "6496",
> > > "6457", "6448".
> > >
> > >
> > > This looks like a problem with how the XWorkBasicConverter is working
> > > or I have just not figured out how to do this yet.
> > >
> > > I would have thought that there's support for passing a List through a
> > > form without the need for creating a custom converter for this.
> > >
> > > Does anyone have any ideas on how to overcome this problem?
> > >
> > >
> > > Regards,
> > > Steve
> > >
> > >
> > >
> >  Hi Steve,
> >
> >  I've seen this before but didn't have time to investigate.  I just split
> > the string into an array in my action.
> >  I agree it should work as you've described without a custom converter. But
> > doesn't. Or doesn't always. Or doesn't give enough feedback about why it
> > didn't.  If you have time, it would be helpful if you can see if an issue
> > exists in JIRA and if not create one.
> >
> >  regards,
> >  Jeromy Evans
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >  For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Mime
View raw message