Dear Friends, We use <html:select name="formName" property="propertyName" disabled="true" style="width:240" size="5" multiple="true" styleId="styleId"> </html:select> Here we use a Hashmap to hold the data. So html ptions tag could not be used for displaying options. 1) We could not hold the data usr selected when user submits this page to another page. 2) We could not get the values of the multilist values in Action Class. It always return empty String array. Please help.
If your using a HashMap, you can use a logic:iterate tag to write the options into the html:select tag. You don't say what solution you came up with to get the options on screen, so it's hard to say why the selections aren't in your bean.
posted 16 years ago
We use <logic:iterate> to iterate and display options. In the next screen we have to display whatever the options user selected. It is happening. Now user can navigate back thru the Back button we are providing in this screen. When user reaches the previous screen the multi list is not holding the data. This is one issue. Now We need to capture this information in a database. So Action Class needs to access this form element. In action class it always empty. This is the another one I need to get some help to resolve. I declare String array in Form class with get and set methods Thank you
posted 16 years ago
I'll call the page with the options page1 and the result page page2. The user selections are making it from page1 to page2?, if so, your form is working, at least for that. On page2 is a back button, which returns the user to page1, but the selected options aren't redisplayed, nor are they in the Form in the Action called by page2. I suspect the Form is in the request instead of the session, and you're probably implementing the ActionForm.reset() method in your Form. Bump the Form up to the session so it can persist across requests, and implement your own reset method (maybe resetFields() ) so you can control when it's called. Also, the iterate tag doesn't work with the html:select tag to show selected options, it will only populate the select box. You're putting a HashMap into the request or session for the iterate tag to use, you can easily convert it to a Collection, put that in and use the options tag. Or, read the source for html:options and make your own custom tag that will work with a HashMap.
Let's get him boys! We'll make him read this tiny ad!