[jira] Commented: (WICKET-627) Can't visit components in a ListView before they're rendered.
[ https://issues.apache.org/jira/browse/WICKET-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515288 ] Matej Knopp commented on WICKET-627: I've commited something that should allow hierarchy change in onBeforeRender (even modifying the parent components). Also it allows you to traverse listview children, but you must call super.onBeforeRender() prior doing that (component.onBeforeRender triggers calling beforeRender on children now). > 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 >Assignee: Igor Vaynberg > 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.
[jira] Commented: (WICKET-627) Can't visit components in a ListView before they're rendered.
[ https://issues.apache.org/jira/browse/WICKET-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515249 ] Alastair Maw commented on WICKET-627: - Yeah, it doesn't really help. I currently don't want to modify the hierarchy, just add behaviours. Does that help any? Or should we be thinking about how to do this in the more general case? Maybe we need some kind of while loop, so we keep calling things until the hierarchy has settled? This is biting us somewhat, as it's a regression bug - this used to work just fine in old pre-attach-refactor snapshots. We're missing our nice required stars on our forms at the moment. ;-( > 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 >Assignee: Igor Vaynberg > 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.
[jira] Commented: (WICKET-627) Can't visit components in a ListView before they're rendered.
[ https://issues.apache.org/jira/browse/WICKET-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515090 ] Matej Knopp commented on WICKET-627: I'm not sure how calling onBeforeRenderChildren from onBeforeRender could help here, nor i'm i aware of all the sideeffect it could possibly bring. Imho the problem is that even if you do it, you'll only have the children components on the nearest level initialized (not the entire hierarchy). To be able to visit the components and add behaviors to all of them, we would imho need to make the initialization two step. (Which would need an extra traversal). Also if we do this, then we would basically allow a child component to add a component to parent component in onBeforeRender. What would call beforeRender on the new component? > 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.