This is getting complex for me...
My form action class has a List of HasHMaps containing key/value pairs of result from the database. The key is the table column name and the value is the value for that column. The is one key/value pair that has multiple values(like the column being choice which has comma separated values like yes,no or accept,decline,ok...)
I am using logic:iterate tag like:-
<logic:iterate id='rows' name='LIST_NAME'> (LIST_NAME exists in the request)
to display the rows with the values from the list of HashMaps. I want to display the choices not as a comma separated
string but want to parse the choices and insert the values(yes,no) into a drop-down box.
I have used
<html:select name='formName' property='selectedValue'>
<html
ptions
collection='LIST_NAME'
property='rowId'
labelProperty='choices'/>
</html:select>
But I am getting the choices related to all the rows like comma separated values. Guess its not taking for that particulat row. How do I go about doing this. Any help would be appreciated.
---------------------------------------------------------------------------
Wow I got it.
But leaving it here for other members. Maybe helpful...
Well I inserted this code inside my logic:iterate........
<html:select name='formName' property='selectedValue'>
<%
String choiceVal = replyChoiceValue.toString();
StringTokenizer st = new StringTokenizer(replyChoiceVal,",");
while(st.hasMoreTokens()){
String value = st.nextToken();
System.out.println("Value= " + value);
%>
<html
ption value="<%=value%>"><%=value%></html
ption>
<%}%>
</html:select>
Well just wondering if I can get rid of the scriptlets... :roll:
[ May 28, 2004: Message edited by: Nicolas Flammel ]