Ticket #677 (closed defect: fixed)

Opened 21 months ago

Last modified 3 months ago

Components inside a disabled Container are not disabled

Reported by: Artur Signell Owned by: Marc Englund
Priority: critical Milestone: User Interface Library 5.2.9
Component: undefined Version:
Keywords: Cc: marc.englund@…, joonas.lehtinen@…
Known Issue description:
Hours estimate: Deadline (dd.mm.yyyy):
Known Issue version (since): Known Issue title:
Hours done: Depends to:
Affects documentation: no
Known Issue workaround:
Affects release notes: yes Contract:

Description (last modified by Matti Tahvonen) (diff)

When a for example a panel is disabled, components inside it used to be (not sure?) disabled. Currently components inside a disable panel are rendered as disabled but are not really disabled.

Change History

Changed 21 months ago by Artur Signell

Same problem with Form.

Changed 21 months ago by Jani Laakso

I've noticed this too, but is this a bug? Isn't this correct functionality?

Changed 21 months ago by Jani Laakso

Ignore last comment, mixed it up with setVisible which seems to work.

So it seems that setVisible(false) is cascaded to all components within the container but setEnable(false) is not.

Changed 21 months ago by Jani Laakso

  • owner changed from Jani Laakso to Matti Tahvonen

On Millstone this has worked (if Artur's memory serves right)

Changed 12 months ago by Joonas Lehtinen

  • milestone set to User Interface Library 5.1.0 RC

Changed 11 months ago by Joonas Lehtinen

  • priority changed from major to undefined

Changed 10 months ago by Jani Laakso

See also #767

Changed 10 months ago by Matti Tahvonen

  • description modified (diff)
  • summary changed from Components inside a disabled Panel are not disabled to Components inside a disabled Container are not disabled

Changed 10 months ago by Matti Tahvonen

  • milestone changed from User Interface Library 5.1.2 to User Interface Library 5.2 enhancement candidates

Currently it is up to developer to do child component disabling. Maybe it will be implemented later.

Changed 8 months ago by Matti Tahvonen

  • milestone deleted

will not fit into 5.2

Changed 8 months ago by Joonas Lehtinen

  • milestone set to User Interface Library 5.3.0 RC1

Changed 5 months ago by Joonas Lehtinen

  • owner changed from Matti Tahvonen to Artur Signell
  • status changed from new to assigned

Changed 5 months ago by Joonas Lehtinen

  • priority changed from undefined to critical

Changed 5 months ago by Artur Signell

  • status changed from assigned to accepted

Changed 5 months ago by Artur Signell

  • status changed from accepted to closed
  • resolution set to fixed

Fixed for AbstractComponentContainers? and Form in [5252] and [5253]

Changed 4 months ago by Matti Tahvonen

  • cc marc.englund@…, joonas.lehtinen@… added
  • status changed from closed to reopened
  • resolution deleted

Fix is not valid. Makes situation just weird with multiple levels. Improved test case in 5450.

Also I wouldn't like to see public setDisabledByContainer method in AbstractComponent?. It is leaked to all components and is more easily hit by developer than setEnabled method.

Correct way would be to recursively check the whole tree in isEnabled, but this'd sure add some overhead for render phase.

If a well working solution is not found, I'd suggest that we keep in the old implementation (enabled flag is only for component it self, not childs), emphasis this in documentation and maybe add helper to disable/enable whole child tree.

Changed 4 months ago by Marc Englund

Sort of with Matti here; 'climbing' upwards would be a great solution, except that the default case (no disabled parents) is actually the worst case performance-wise.

As a compromise, perhaps the naming of the setDisabledByContainer() should be changed, so that it's not used accidentally?

Some alternatives:

  • An additional setEnabled(boolean enabled, boolean parentEnabled) would perhaps be sufficiently weird so that it's not used accidentally?
  • An additional setEnabled(boolean enabled, ComponentContainer? setBy) would also make the developer read the javadoc, and could throw if setBy!=parent.

Also note that in any case, the ComponentContainer? should reset this state when a component is attached to it (addComponent())

Changed 4 months ago by Matti Tahvonen

Note, naming issue is only a side story. Issue with current implementation: two disabled parent containers -> child enabled (although theme works).

Changed 4 months ago by Joonas Lehtinen

  • owner changed from Artur Signell to Marc Englund
  • status changed from reopened to assigned

Changed 4 months ago by Marc Englund

  • status changed from assigned to accepted

Changed 4 months ago by Marc Englund

Mostly fixed in [5513], Table still needs fixing.

Changed 4 months ago by Marc Englund

  • status changed from accepted to closed
  • resolution set to fixed

Table fixed in [5514]

Changed 4 months ago by Marc Englund

Oops, [5515] too...

Changed 3 months ago by Marko Gronroos

  • milestone changed from User Interface Library 5.3.0 RC to User Interface Library 5.2.9
Note: See TracTickets for help on using tickets.