Dear All, I want to do something like this:
in my action i create:
List<String> textFields = new ArrayList<String>();
and i tried to write set method in 2 ways:
1. public void setTextFields (List<String> textFields)
2. public void setTextFields(String text)
{
textFields.add(text);
}
and in my jsp, i want to get something like this:
<s:iterator ...>
<s:textfield name="textFields[%{#status.index}]"/>
</s:iterator>
But I found that for both setter methods, there are errors:
com.opensymphony.xwork2.util.OgnlValueStack - Caught an exception while
evaluating expression 'test_string[0]' against value stack
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
Can anyone help me on how to create such a dynamic textFields (Considering
action implementation)? Thanks in advance!
--
Best Regards,
Licco