Re: Form fields based on List

2013-02-15 Thread Ivan Khalopik
And your encoder (that uses value index within list) can be replaced with formState="iteration" on loop component -- BR Ivan

Re: Form fields based on List

2013-02-15 Thread Ivan Khalopik
You can wrap this fields with custom component, e.g. CoordinateEdit. Then inject all needed fields using @InjectComponent annotation. In afterRender or cleanupRender method you can use such trick: private static final ComponentAction VALIDATE = new ComponentAction { public void execute(Coordina

Re: Form fields based on List

2013-02-15 Thread nquirynen
Now for validation purposes I need to be able to access these created fields in my onValidate method. Any idea how I can achieve this? I saw ComponentResources.getEmbeddedComponent(), but have not had success with that yet. Any pointers? -- View this message in context: http://tapestry.104571

Re: Form fields based on List

2013-02-15 Thread nquirynen
Hi, I solved it by adding the encoder parameter as you suggested: public ValueEncoder getEncoder() { return new ValueEncoder() { @Override public String toClient(CoordinateDto value) { return String

Re: Form fields based on List

2013-02-15 Thread Thiago H de Paula Figueiredo
On Fri, 15 Feb 2013 08:31:40 -0200, nquirynen wrote: Hi, Hi! It does show all the values, but on submit it says: Could not find a coercion from type java.lang.String to CoordinateDto You need to provide a ValueEncoder for Loop with text fields to work inside a Form (Loop'

Re: Form fields based on List

2013-02-15 Thread Shing Hing Man
Form fields based on List 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 gette

Re: Form fields based on List

2013-02-15 Thread Shing Hing Man
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 cal