aspose file tools*
The moose likes Struts and the fly likes Struts Indexed problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Indexed problem" Watch "Struts Indexed problem" New topic
Author

Struts Indexed problem

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
Is it possible to submit an entire collection from an action form?
All the examples I have seen uses iterate to display data alone. In
order to edit them, you will have to click on a link to get into a
seperate form. I am wondering whether it's possible to edit the data
in an iterate. For example, I have:

TaskId webLabel value
001 Company XXX
002 Result Good

Submit Cancel

I would like to be able to edit the value figure on this form and
then pass to a ActionForm to validate the values entered and then pass it to the action class to be saved.

Currently I have:

In this jsp

<logic:iterate id="misTaskData" name="misTaskDataVec">
<tr class="trClass">
<td class="tdClass" width="291"><bean:write name="misTaskData" property="webLabel"/></td>
<td class="tdClass" width="215"><html:text name="misTaskData" property="value" styleClass="textLargeClass" />
</td>
<html:hidden name="misTaskData" property="taskSumId"/>
<html:hidden name="misTaskData" property="taskId"/>
<html:hidden name="misTaskData" property="taskFieldId"/>
<html:hidden name="misTaskData" property="webFieldSize"/>
<html:hidden name="misTaskData" property="dataType"/>
</tr>
</logic:iterate>

I need to validate the data entered which can be done in the ActionForm but i do not know how to read the individual values
Could somebody provide an example on how should I do this please?

Thank you in advance
Anil Raju
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Moving to the Frameworks forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312

Is it possible to submit an entire collection from an action form?


Yes, you can do it.




I need to validate the data entered which can be done in the ActionForm



If you want to validate data, you can use Struts Validation Framework to validation data.
AT http://www.javaranch.com/newsletter/Mar2003/newslettermar2003.jsp#struts

but i do not know how to read the individual values


What does "the individual values" mean ??


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
 
jQuery in Action, 2nd edition
 
subject: Struts Indexed problem