Below is a possible solution.

Instead of 
@Property
private CoordinateDto coordinate;

implements your own setter getter method for CordinateDto

public  CoordinateDto  getCordinateDto(){
   ...
}


public void setCoordinate(CoordinateDto dto){
   ....
}

The getter and setter methods will be called during rendering and submission. 
Hence the implementation needs to cater for the rendering phase  and submission 
phase. 

The example below does something similar.

http://lombok.demon.co.uk/tapestry5Demo/test/sum


Shing 





----- Original Message -----
From: nquirynen <nat...@pensionarchitects.be>
To: users@tapestry.apache.org
Cc: 
Sent: Friday, February 15, 2013 10:31 AM
Subject: Form fields based on List

Hi,

I have a form where a part of it consists of a List. I tried to do the
following:

*.java*

@Property
private List<CoordinateDto> coordinates;

@Property
private CoordinateDto coordinate;
    
@Property
private int loop = 0;

*.tml*

<t:loop t:source="coordinates" t:value="coordinate" t:index="loop">
   <t:textfield t:value="coordinate.value"></t:textfield>
   <t:textfield t:value="coordinate.description"></t:textfield>
</t:loop>


It does show all the values, but on submit it says:

Could not find a coercion from type java.lang.String to CoordinateDto

How should I handle this?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Form-fields-based-on-List-tp5720042.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

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

Reply via email to