struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Broadhurst <hou1...@gmail.com>
Subject Re: UpDownSelect & JPA
Date Fri, 05 Nov 2010 14:35:44 GMT
Thanks guys! String setup was legacy for single select which worked fine.
Select is populated with entity list so will re-work form entity to have
select list entity as property and go from there. Cheers!
On Nov 5, 2010 6:02 AM, "Maurizio Cucchiara" <maurizio.cucchiara@gmail.com>
wrote:
> You should re-shape your DB design IMHO. If you expect multiple values
> for an entity property why do you declare as a plain string? You
> should consider to represent as at least an integer array (or even as
> an entity).
>
>
> 2010/11/5 Nick Broadhurst <hou1nxb@gmail.com>:
>> Hi All,
>>
>> I am using the struts2 updownselect for getting multiple selections from
>> user. It is populated by a list and works great as long as only one item
is
>> selected. The datatype in mysql where the field is being persisted to is
a
>> string. If one item is selected, the ID (listKey) goes into the db and
when
>> I retrieve the object for re-display in the form, that item is selected
in
>> the updownselect. Perfect! But when multiple items are selected, a comma
>> seperated list of the selected listKeys go in the db field. The problem
is
>> when this comes back out, the updownselect doesn't display the previously
>> selected items. I am guessing because it does not know how to interpret
the
>> comma separated list.
>>
>> I am just wondering what it would take to get struts to translate the
list
>> and display the populated values. An array datatype or something? MySql
>> doesn't have that does it? Serialize it? Doesnt sound like a good fit and
I
>> just don't know what struts is expecting when it needs to display
multiple
>> items selected. Thanks for any ideas.
>>
>> Nick
>>
>
>
>
> --
> Maurizio Cucchiara
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message