Form for multiple entities

2011-04-15 Thread sockmonster
Hi,
I have a table to entities that I get from my database, the number of
entities can increase and decrease as these entities can be added or
deleted. I want to be able to edit the entities in the table. The first
column of every row has a check box to indicate whether that row should be
updated when the submit button below the form is pressed.

I understand how to create a form for a javabean or a form with a fixed
number of input elements but how do I handle variable numbers of beans/input
element.

Many thanks.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Form-for-multiple-entities-tp4305672p4305672.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Form for multiple entities

2011-04-15 Thread Christian Köberl

I understand how to create a form for a javabean or a form with a fixed
number of input elements but how do I handle variable numbers of beans/input
element.


Just surround the part of your form with a Loop component.

Something like:
t:form
  t:loop source=myBeanList value=currentBean
 t:textfield value=currentBean.myProperty /
  /t:loop
  t:submit /
/t:form

If you want to add rows via AJAX use AJAXFormLoop component.

--
Chris

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org