struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@lexmark.com
Subject RE: pre-selected values in multi-select box not working?
Date Wed, 26 Mar 2003 17:08:10 GMT

Okay, here's the code (thought I could get away with just another qu, but
was looking at the wrong code!!).

in my form bean:
         String[] _promptValues = new String[0];

in my jsp:
         <html:select size="5" multiple="true" styleId="multiSelect" name
="promptForm"
                                                      property
="promptValues">
                       <html:options name="Prompt" property="comboValues"/>
                  </html:select>

Obviously have appropriate get/setters for promptValues.  In my action, I
set promptValues to those that Strings I want selected, but nothing happens
when the page is loaded.

This *should* work, right?

Cheers,

David




"Sri Sankaran" <Sri.Sankaran@sas.com> on 03/25/2003 09:33:26 PM

Please respond to "Struts Users Mailing List"
       <struts-user@jakarta.apache.org>

To:    "Struts Users Mailing List" <struts-user@jakarta.apache.org>
cc:
Subject:    RE: pre-selected values in multi-select box not working?


I don't know what "value" you are referring to; the default selection(s)
are predicated by the value of the "property" attribute.  To repeat my
original response, please post relevant portions of your form-bean and JSP.

If you are disinclined to do so, the example to which I referred you should
help.

Sri

-----Original Message-----
From: dhay@lexmark.com [mailto:dhay@lexmark.com]
Sent: Tuesday, March 25, 2003 5:58 PM
To: Struts Users Mailing List
Subject: RE: pre-selected values in multi-select box not working?



Hi Sri / Mohan,

Does the "value" need to be a String or a String[] if multiple=true is set,
for value to be pre-selected?

Many thanks,

David




"Sri Sankaran" <Sri.Sankaran@sas.com> on 03/24/2003 09:53:13 PM

Please respond to "Struts Users Mailing List"
       <struts-user@jakarta.apache.org>

To:    "Struts Users Mailing List" <struts-user@jakarta.apache.org>
cc:
Subject:    RE: pre-selected values in multi-select box not working?


Need more information.  Please post relevant portions of your form-bean and
JSP.

Have you taken a look at the html-select.jsp in the struts-exercise-taglib
application that ships with Struts?

Sri

-----Original Message-----
From: dhay@lexmark.com [mailto:dhay@lexmark.com]
Sent: Monday, March 24, 2003 5:36 PM
To: struts-user@jakarta.apache.org
Subject: pre-selected values in multi-select box not working?


Hi.

Can anyone tell me if this is working please?  I have a String[] which
holds the values selected in a multi-select box.  The submission part works
fine, but pre-selecting the values does not.  ie if I populate the String[]
with values that should show up already selected when the page is
displayed, nothing happens.

Please help!

Many thanks,

David





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


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









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


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









---------------------------------------------------------------------
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