Using onConfigure doesn't help much. If I disable the common parent, and
call setEnabled in onConfigure in the few components I want visible, the
components will still be disabled during the rendering phase because
onComponentTag calls isEnabledInHierarchy.

I could override onConfigure in every component, and read the field that
controls the enabling/disabling, but that would create a lot of boilerplate
code for the 80-90% of FormComponents/links that should be disabled. It
would be a lot cleaner to disable the parent, and only handle the ones I
want enabled.

--einar

On Wed, Dec 1, 2010 at 1:21 AM, Igor Vaynberg <[email protected]>wrote:

> have a field in the page that controls whether or not these components
> should be enabled/disabled, then override their onconfigure() methods
> and setenable/disabled based on the field.
>
> -igor
>
> On Tue, Nov 30, 2010 at 3:17 PM, Einar Bjerve <[email protected]>
> wrote:
> > Hi all,
> >
> > How can we enable/disable almost an entire hierarchy under certain
> > circumstances, while still keeping some of them open for
> editing/clicking?
> >
> > The obvious solution would be to enable/disable the ancestor and override
> > isEnabledInHierarchy for the few components that should still be enabled,
> > but it's final so can't do that.
> >
> > We also tried writing a behavior that traversed all children and set the
> > affected FormComponents/Links to disabled. But that didn't work either.
> We
> > can't do it in beforeRender() because the render phase has started when
> it
> > is called and then setDisabled will fail. And we can't do it in bind()
> since
> > some of the children to be disabled is FormComponents in a DataView, and
> > children of a DataView isn't added until onBeforeRender - so they aren't
> > available yet.
> >
> > Overriding isEnabled in every component that should be disabled isn't
> really
> > an option either, due to the amount of components affected.
> >
> > Any suggestions?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to