> -----Original Message-----
> From: Maurice Marrink [mailto:[EMAIL PROTECTED] 
> Sent: Donnerstag, 15. November 2007 01:30
> To: [email protected]
> Subject: Re: isEnabledInHierarchy?
> 
> Sounds logical. And i think you can do it yourself by 
> checking the isEnabled and isEnableAllowed flags in 
> onBeforeRender of MarkupContainers and then use a visitor to 
> update all childs.

No, that doesn't work if anything under the root is updated via AJAX.
What I could do is attach a behaviour to all children which changes the
enabled flag at render time, but that will not work with versioning
(checkHierarchyChange).

> Only problem i see is that changes made after the container 
> has done this are not detected but the same is true (i think) 
> if wicket were to do this in the render phase.
> 
> Maurice

It would too work with later changes, what I'm proposing is not changing
the enabled flags, but rendering a component based on enabled state from
the parent chain instead of just the component itself. Of course, the
component in question would always render as disabled as long as an
ancestor is disabled, but you don't lose any state changes.

I do understand that there are workarounds for this (and I'm
implementing one myself right now). The question is: would this be a
good idea for wicket itself or am I missing something here?

cheers

Thomas

Reply via email to