Hi,
Yep, got getPromptValues(), and yep, I call action to populate form before
forwarding on success to page.
Cheers,
David
"Sri Sankaran" <[EMAIL PROTECTED]> on 03/26/2003 12:53:15 PM
Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:
Subject: RE: pre-selected values in multi-select box not working?
The property attribute for the <html:select> is "promptValues" but the
property in your form bean is "_promptValues". Hopefully you have
getPromptValues().
Assuming all that is ok, how are you populating the values. Is the
form-bean being created before the page is loaded?
Sri
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 12:08 PM
To: Struts Users Mailing List
Subject: RE: pre-selected values in multi-select box not working?
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" <[EMAIL PROTECTED]> on 03/25/2003 09:33:26 PM
Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
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" <[EMAIL PROTECTED]> on 03/24/2003 09:53:13 PM
Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 5:36 PM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]