[ 
https://issues.apache.org/jira/browse/WICKET-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alastair Maw updated WICKET-627:
--------------------------------

    Description: I'm trying to create a Form subclass which automatically adds 
a Behaviour to all of its FormComponents using a visitor. The only place to do 
this is in the Form's onBeforeRender() method. This works fine, until you put 
your FormComponents into a ListView, at which point it doesn't work, because 
the ListView children are yet to be created.  (was: I've discussed this with 
Johan and we think we need to make onBeforeRenderChildren() protected.

<AlMaw> I have a ValidationTaggedForm extends Form.
<AlMaw> And in onBeforeRender, I call visitChildren(validationTaggingVisitor)
<AlMaw> And the validationTaggingVisitor adds a behaviour.
<AlMaw> If I have a ListView in the Form, onBeforeRender for the Form is called 
before the ListView populateItem calls.
<AlMaw> Thus the components added in the ListView aren't visited.

We can't just swap the order of the calls to onBeforeRender() and 
onBeforeRenderChildren() in Component#beforeRender() because that will break 
existing code and the repeaters. Besides, someone will only want to do things 
the other way around at some later date (e.g. attach a behaviour to a parent 
using a child then needs to reference/find).

Suggested solution is to make onBeforeRenderChildren() protected, which will 
allow as much flexibility as you like.)

> Can't visit components in a ListView before they're rendered.
> -------------------------------------------------------------
>
>                 Key: WICKET-627
>                 URL: https://issues.apache.org/jira/browse/WICKET-627
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.0-beta1
>            Reporter: Alastair Maw
>             Fix For: 1.3.0-beta3
>
>
> I'm trying to create a Form subclass which automatically adds a Behaviour to 
> all of its FormComponents using a visitor. The only place to do this is in 
> the Form's onBeforeRender() method. This works fine, until you put your 
> FormComponents into a ListView, at which point it doesn't work, because the 
> ListView children are yet to be created.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to