struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <dgraham1...@hotmail.com>
Subject Re: <html:select multiple="true" not working...
Date Wed, 19 Mar 2003 18:41:17 GMT
You can't use String[] inside a Map backed field.  The value will get 
overwritten by the next property of the same name in the map.  Use a 
String[] to support multi valued select boxes.

David



>From: "WILLIAMS,RAND (HP-USA,ex1)" <rand.williams@hp.com>
>Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>To: 'Struts Users Mailing List' <struts-user@jakarta.apache.org>
>Subject: <html:select multiple="true" not working...
>Date: Wed, 19 Mar 2003 10:08:00 -0800
>
>Anyone tried this?
>
>Using a map backed form, where
>set(key,val) { mymap.put(key,val) }
>and get(key) { return mymap.get(key) }
>
>I am having a problem with String[] and multiple attribute of html:select:
>
><html:select property="value(selectProduct)" multiple="true">
>  <logic:iterate id="x" name="telecomModel" property="services" >
>   <bean:define id="y" name="x" property="product" />
>    <html:option value='<%=(String)y%>' />
>  </logic:iterate>
></html:select>
>
>Even though value(selectProduct) gives to the tag
>[INFO] SmModelForm - - getValue(selectProduct) = [Ljava.lang.String;@deb5f
>which is a String[0]
>
>The problem i see is beanUtils still populates the field with only a 
>string:
>
>[INFO] SmModelForm - - setValue(selectProduct,U3995)
>which is merely a String - not a String[] with an element (String) "U3995".
>
>Is there something wrong or am I missing something here??
>Is there an issue with retrieving or setting the String[] from a HashMap?
>
>Thanks in advance for help :)
>-Rand
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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


Mime
View raw message