[EMAIL PROTECTED] wrote:
Using Struts 1.1
Problem:
Problem displaying available choices in Select option list when using
Validator sends me back to my input page.
Details:
I have 2 html select dropdown boxes on my web page. The values that appear
inside come from my database, and are sent to my form inside my form bean.
On the initial JSP rendering my page displays fine. My problem occurs when
the page doesn't pass a struts validation rule, and formbean is sent back
to my input page. My formbean property that was holding my List of objects
is now null, and I need to redisplay the list of available choices back on
my page.
struts html that I am using
<html:select name="UserProfileForm" property="select1" styleClass=
"standardText" multiple="true">
<html:optionsCollection name="UserProfileForm"
property="unSubscribedGroupDisplay"
value="grpId"
label="grpDesc" />
</html:select>
Note:
UserProfileForm.getUnSubscribedGroupDisplay() returns a List of Objects,
and these objects have a set/getGrpId and set/getGrpDesc
How is UserProfileForm instantiated and initialized? What do your action
mappings and form bean definitions look like? Without more information
it's impossible to say definitively what's wrong.
The most likely explanation is that you are returning control directly
to a JSP when validation fails rather than to the action that sets up
the form bean. If you have an action that runs and then forwards to the
JSP the first time it's shown, you need to name that action in the
'input' for the action that's executed on form submission, rather than
the JSP itself.
If that doesn't make sense, post the rest of your configuration and
code, or at least describe how you have everything configured.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]