Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

loop inside a form

$
0
0
Hello,

as said in title I have a loop on a list of objects (with his encoder) :

<t:Form t:id="formUpdateType">
<t:Errors />
<table >
<tr >
<th>${message:typeName}</th>
<th>${message:remarks}</th>
<th></th>
</tr>
<t:Loop t:source="typeClientDtoList" t:value="typeClientDtoLoop"
t:encoder="typeClientDtoEncoder">
<tr>
<td>
<t:TextField t:value="typeClientDtoLoop.NomType" />
</td>
<td>
<t:TextField t:value="typeClientDtoLoop.Remarques" />
</td>
<td>
<t:ActionLink t:id="delete"
context="typeClientDtoLoop.Id">${message:delete}</t:ActionLink>
</td>
</tr>
</t:Loop>
</table>
<t:submit value="${message:updateTypes}" class="button" />
</t:Form>

I initialize the list of objects in onActivate() :

// initialize list of types if null
if (typeClientDtoList == null) {
typeClientDtoList = new ArrayList<TypeClientDto>();
typeClientDtoList = serviceTypeClient.findAllTypeClientDto();

I would like to be able to update/merge in DB all modifications of all
objects in my list
But when I go in the validate event of my form when I submit, each objects
still contains the initial values, not the modifications made in the
displayed textfields. It's like there is no synchronization between the
textfield and the objects.

What am I doing wrong ? How can I achieve what I want ?

Viewing all articles
Browse latest Browse all 5648

Trending Articles