struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zafer Mohamed <mzaferm...@yahoo.com>
Subject Populating collection in struts 2 Action properties
Date Sat, 03 Feb 2007 17:40:45 GMT
I am struggling to populate a collection in the struts action's attribute. My scenario is similiar
to below

public class PersonAction extends ActionSupport {

 

private Person person;

public void setPerson(Person 
person){  this.person = person}
public Person getPerson(){  return person}
 

 public String submit() throws Exception {

  return SUCCESS;

 }

}


And my Person class is 

public class Person
{
    private List roles;
    public List getRoles() { return roles; }

    public void setRoles(List roles) { this.roles = roles; }

}

And from my JSP I am trying to populate as below

<s:textfield label="Name" name="person.roles(0).name" />

If someone has a working scenario like this, please send me the todo's to get it working.
I have searched the webwork forms and tried most the tricks mentioned there with no luck.

Thanks
Zafer




 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message