You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sockmonster <ol...@gmail.com> on 2011/04/15 16:22:28 UTC
Form for multiple entities
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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Form for multiple entities
Posted by Christian Köberl <ta...@gmail.com>.
> 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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org