You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dimitris Mouchritsas <di...@eurodyn.com> on 2008/07/21 14:58:37 UTC

Form Submission of arrays

Hi all,
we've got a form where there's a table. In each row there's a hidden 
field for the id, a comment (text field) and a select box.
What's the best way to submit this form? Create a form bean that will 
accept arrays as input?
e.g.

public class CommentForm {
  private String[] orgIds;
  private String[] comments;
  private String[] types;

  ...getters/setters

  public String getRow(int num) {
    return orgIds[num] + "$" + comments[num] + "$" + types[num];
  }
}

Is the above class correct?
Does struts guarantee that the order in which the rows are declared is 
the same order in the array when the form bean is submitted?

Thanks
Dimitris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org