This is rather Spring MVC specific. Let say I'm using
SimpleFormController and I have a command object that looks like this:

public class ItemsForm {
   List<Item> items;
}

A domain object Item:

public class Item {
   private String id;
   private String description;

   // getters and setters...
}

Suppose my command name is "form", the rendered view may look like
this (by formBackingObject()):

<form>
   <input type="text" name="form.items[0].description" value="...">
   <input type="text" name="form.items[1].description" value="...">
   <input type="text" name="form.items[2].description" value="...">
   ...
</form>

So, my question is, do we need to include the id as hidden fields like
form.items[0].id, etc in the form? How does Spring MVC know how to
bind each item in the list of items during onSubmit? Is it by the
index of the array or is it by the id?


--
Jong Hian Zin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to