I've got a page where a purchase can be entered, along with all of the foos bought. I've got three elements in a html document that are parsed into a comma-separated format.
function submitStuff()
{
//grab each cells value from dynamically built table based on user entries
//appending comma
document.form.ids.value=Ids;
document.form.price.value=prices;
document.form.qtys.value=qtys;
document.form.submit();
}
Once broken up,each id/price/qty should populate into an an object...
public class foo{
private int id;
private BigDecimal price;
private int qty;
//set&get;
}
which can belong as a collection to another object...
public class purchase{
private Date date;
private int buyId;
private List<foo> purchases;
//set&get;
}
I know I can just grab the request parameters and build the foo objects one by one. I figured there is a better way to populate that list while the data binding is performed on the purchase object, since it populates all other properties correctly.