You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/01/19 01:50:00 UTC

[jira] [Commented] (WICKET-6946) isVisibleInHierarchy/isEnabledInHierarchy broken by isVisible/isEnabled override

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

ASF GitHub Bot commented on WICKET-6946:
----------------------------------------

mat128 opened a new pull request #493:
URL: https://github.com/apache/wicket/pull/493


   Document limitations of overriding isVisible/isEnabled
   
   This PR also improve various sections around the edited paragraphs. I can split them in different commits if need be.
   
   Also, I'm aware of the whole override vs non-override debate and this PR only serves as documenting (some of) the pitfalls of doing so.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> isVisibleInHierarchy/isEnabledInHierarchy broken by isVisible/isEnabled override
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-6946
>                 URL: https://issues.apache.org/jira/browse/WICKET-6946
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>            Reporter: Mathieu Mitchell
>            Priority: Major
>
> Currently, isVisibleInHierarchy and isEnabledInHierarchy can return invalid values when isVisible or isEnabled is overridden. The problem is caused by the caching done in isVisibleInHierarchy/isEnabledInHierarchy. Currently, the cache is invalidated in setVisible/setEnabled. The cache invalidation is not done when components are overriding isVisible/isEnabled.
> Additionally, the documentation mentions impacts of overriding isVisible/isEnabled when using "non-trivial" code, as the methods are called multiple times and can slow down page rendering.
> The best practices chapter mentions overriding isVisible/isEnabled as the appropriate approach. Another best practices page mentions that a component factory should not be used because it prevents overriding isVisible/isEnabled in an anonymous class.
> There is no clear warning that overriding isVisible/isEnabled can break isVisibleInHierarchy/isEnabledInHierarchy when the returned value can change.
> There is also no indication that overriding isVisible/isEnabled is not recommended.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)