This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Indexed problem

 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Frameworks forum.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ??
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic