[ https://issues.apache.org/jira/browse/WICKET-3398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12987970#action_12987970 ]
Ulrike M commented on WICKET-3398: ---------------------------------- Thanks for the fix. Only a detail but wouldn't it have been cleaner to override onConfigure() in EnclosureContainer and call child.configure() from there (instead of from isVisible()), since one call to child.configure() is certainly enough. > EnclosureContainer: configure() should be called on the child component > before calling isVisible on it > ------------------------------------------------------------------------------------------------------ > > Key: WICKET-3398 > URL: https://issues.apache.org/jira/browse/WICKET-3398 > Project: Wicket > Issue Type: Bug > Components: wicket > Affects Versions: 1.4.15, 1.5-RC1 > Reporter: Ulrike M > Assignee: Igor Vaynberg > Priority: Minor > Fix For: 1.4.16, 1.5-RC2 > > > As advised by the javadoc for Component#onConfigure, we switched to this > mechanism instead of overriding isVisible/isEnabled when they contain > extensive logic. > Now if we do that for a child component that will control the visibility of > the EnclosureContainer, EnclosureContainer#isVisible directly calls through > to #isVisible on the child component, and this may happen before #onConfigure > on the child ever gets called. In our situation where we set the visibility > in #onConfigure, the result of #isVisible may change during the request > cycle, which may lead to undesirable and confusing results. > The javadoc for Component#configure states that for linked components, > #configure should be called on the 'other' component. Applied to > EnclosureContainer, I think the correct way to handle this is that > EnclosureContainer#onConfigure must be overridden in order to call > child.configure(). This way, any call to #isVisible will only occur after > #onConfigure has been called, the sequence is correct again. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.