Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
how to get text input in logic iterate
rajesh mahendran
Greenhorn
Posts: 9
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
how to get input in logic:iterate and to pass it to action class
input.jsp
<html:form action="newupdate"> <table border="1"><tr><th>mark1</th></tr> <logic:iterate name="list12" id="item" property="list"> <html:hidden name="item" property="name" indexed="true"/> <tr><td> <html:text property="m1" name="item" indexed="true" /> </td> </tr> </logic:iterate> </table> <html:submit value="submit"/> </html:form>
in forms package
newupdateform.java(formbean)
public class newupdateform extends org.apache.struts.action.ActionForm { private List list; public List getList() { return list; } public void setList(List list) { this.list = list; } public OrderItem getOrderItem(int index) { if(this.list == null) { this.list = new ArrayList(); } while(index >= this.list.size()) { this.list.add(new OrderItem()); } return (OrderItem) list.get(index); } }
in forms package
OrderItem.java(databean) public class OrderItem { private String m1; public OrderItem(String m1) { this.m1 = m1; } OrderItem() { } public String getM1() { return m1; } public void setM1(String m1) { this.m1 = m1; } }
in package action
newupdate.java
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { newupdateform tyecast=(newupdateform)form; newupdateform=form.getorderlist; if(orderlist.size()>0) { a=success; return a; } else { a=failure; return a; } return mapping.findForward(a); }
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Can we send multiple textfield of same type in struts
Not able to submit data
Struts1: Nested/Indexed properties issue
Check box and Indexed properties
Indexed Properties Example
More...