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<CoordinateEdit> VALIDATE = new
ComponentAction<CoordinateEdit> {
  public void execute(CoordinateEdit component) {
    component.validate();
  }

}

@CleanupRender
void cleanup() {
  formSupport.store(this, VALIDATE);
}

private void validate() {
  // some validation logic
}

After applying this trick validate() method call will be saved as form
action to be executed on form submission immediately after inner fields
processSubmission() actions. So the flow will look like this:
1. restore next iterable value using encoder or from iterator (it depends
on formState parameter of the loop)
2. processSubmission() for all inner field(it includes translation,
validation, value assignment)
3. validate() for CoordinateEdit
4. repeat 1-3 while there are values



On Fri, Feb 15, 2013 at 5:34 PM, nquirynen <nat...@pensionarchitects.be>wrote:

> 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.1045711.n5.nabble.com/Form-fields-based-on-List-tp5720042p5720048.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
>
>


-- 
BR
Ivan

Reply via email to