• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Indexed properties, multiple rows submission using struts

 
Suresh Appagundi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

First thing is, i want to display multiple rows in the JSP for example 5 employee records such that each row says about one employee.

Now i change some data in some rows or all 5 rows in the Form and submit.

How i need to handle this in My action form. I mean how can i use the collection object to store all this 5 employee rows and give back to Action class.

Please give me example, which gives all the struts components, like how the JSP contents should be, ActionForm and Action class.

If there is any link, where i can find some examples, let me know

very urgent.

thanks
in advance
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It still boggles my mind when people as for others to do their work. There's a wonderful page on the Struts website about indexed properties. I suggest you go find it.
 
Chris Rickey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you found any good examples of the indexed properties? Unlike the previous poster, I have read the indexed properties documentation on the struts site and found it to be an abortion.

I have been trying for days to get indexed properties to work they way it seems they should, but there is something I am missing.

I have an object, call it ParentClass. It has properties key (getKey, setKey) and child (getChild, setChild) which is of type ChildClass.
There is another object, call it ChildClass. It also has a property key (getKey, setKey). Each parent has one and only one child.

I have an ActionForm that has property Parents which is a List.

I have an action that finds the Parents I want and puts them in a list and, on my ActionForm, setParents(listOfParents).

So far, so good.

Now, in my JSP, when I try to loop over the parents via
<c:forEach var="aParent" items="${ActionForm.parents}">

I want to set a hidden html field via
<html:hidden property="key" indexed="true"/>

And I want to set a html text field to the child key via
<html:text property="child.key" index="true"/>

But I get an error " No getter method for property key of bean org.apache.struts.taglib.html.BEAN".

Where am I going wrong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic