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 <einar.bje...@gmail.com> 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: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org