[ 
https://issues.apache.org/jira/browse/WICKET-5835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14323009#comment-14323009
 ] 

Raoul Zander commented on WICKET-5835:
--------------------------------------

The "visible1" flag is only used for representation in this quickstart. I found 
the issue in my project when trying to inherit the visibility of a whole 
component hierarchy with some rules over multiple levels, i.e some complex 
logic I wouldn't want to calculate every time in isVisible(). And of course I 
could calculate it one time and cache it in an own flag - but why not use the 
existing infrastructure that exists for exactly this purpose?

To quote from 
[Component#onConfigure()|http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/Component.html#onConfigure()]:
{quote}Why this method is preferrable to directly overriding isVisible() and 
isEnabled()? Because those methods are called multiple times even for 
processing of a single request. If they contain expensive logic they can slow 
down the response time of the entire page. Further, overriding those methods 
directly on form components may lead to inconsistent or unexpected state 
depending on when those methods are called in the form processing workflow. It 
is a better practice to push changes to state rather than pull.{quote}

> InlineEnclosure doesn't call child.configure() before updating its visilbity
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-5835
>                 URL: https://issues.apache.org/jira/browse/WICKET-5835
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.19.0
>         Environment: Any
>            Reporter: Raoul Zander
>            Assignee: Andrea Del Bene
>            Priority: Minor
>              Labels: enclosure
>         Attachments: enclosure-quickstart.zip
>
>
> org.apache.wicket.markup.html.internal.InlineEnclosure.updateVisibility()
> should propably call child.configure() before the visibility of the 
> InlineEnclosure is set to the visibility of the child.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to