You didn't include your struts.xml action mappings so I'm guessing, but
from the behaviour you describe it sounds like the 'input' result is
pointing directly to a JSP, rather than to an action that knows how to
do the data pre-fetch.
L.
Struts2 Fan wrote:
Ok :) I will try to be more specific.
I have a <s:select>, <s:submit>, <s:iterator> on the jsp. When submit is
clicked, it goes to the action and populates the list and every record in
the list puts a textbox on the jsp according to the selected <s:select>.
When the list is populated the user enters the values in the jsp and presses
the update button. If all the fields are not-null every thing is ok. The
values are updated. But when one of the textfields is empty, validation
fails and gives the proper error message. Because of giving validation
error, the request cannot go to action so I cannot repopulate the list with
the entered values. I hope this explaination and codes are enough.
--------jsp-------------
<s:form action="setProperties" method="post">
<s:select name="model.id" list="modelList" listKey="id"
listValue="UIName" theme="simple"/>
<s:submit method="setProperties" key="button.select"></s:submit>
<s:iterator value="subProperties" id="property" status="stat">
<s:textfield name="%{'subProperties['+#stat.index+'].value'}"
label="${property.propertyType.name}"/>
</s:iterator>
<s:submit key="button.updateProperties" method="updateProperties"/>
</s:form>
</body>
</html>
---------------------------------
---------action methods----------
public String setProperties() throws Exception{
setModel(modelManager.get(model.getId()));
subProperties = model.getPropertyList();
return SUCCESS;
}
public String updateProperties() throws Exception{
for (Property property : subProperties) {
// I update the properties with the inputs got from jsp
}
// assign subProperties again here
return SUCCESS;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]