Hi
Our pre-selection is working though. Actually our values are in the
database . So we use a populate action that other actions extend.
We apply a pre-selection filter like this to make the first value of a
multi-select drop-down always selected.
The values are in a ArrayList in the scope.
Get the value bean.
LabelValueBean bean =( LabelValueBean )((( ArrayList
)request.getSession().
getAttribute( name )).get( 0 ));
Create a filter.
ArrayList preselectedFilter = new ArrayList();
preselectedFilter.add( bean.getValue() );
Apply the filter.
form.setData( ( String[] ) preselectedFilter.toArray( new String[0]
) );
After this set the form bean in the appropriate scope. This might
help.
Mohan
-----Original Message-----
From: Sri Sankaran [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 8:23 AM
To: Struts Users Mailing List
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]