-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Using ZK 5.0.7:
I've found that when showing a disabled and selected treeitem of a tree with checkmark="true", the checkbox is not correctly rendered.
I suppose this is not a feature as the selected state of the treeitem is not altered when disabling it, it's just a rendering / style issue.
I understand that a disabled treeitem cannot be selected, but imho it should show if it's selected or not when disabled.
A small example to reproduce the scenario:
<button label="Show state" onClick='alert("1.selected = " + ti1.isSelected() + "\n1.disabled = " + ti1.isDisabled() + "\n2.selected = " + ti2.isSelected() + "\n2.disabled = " + ti2.isDisabled())' /> <button label="Toggle disable" onClick="ti1.setDisabled(!ti1.isDisabled()); ti2.setDisabled(!ti2.isDisabled())" /> <tree checkmark="true" multiple="true"> <treechildren> <treeitem id="ti1" checkable="true" selected="true"> <treerow><treecell label="1" /></treerow> </treeitem> <treeitem id="ti2" checkable="true" selected="true"> <treerow><treecell label="2" /></treerow> </treeitem> </treechildren> </tree>
My use case is:
- An entity detail where a user can select some items of a tree.
- The entity editing is blocked by other user.
- When the first user access to the entity detail, the tree should be disabled, but the selected items shown.
Will.
i think this is a spec of ZK, i tried listbox with listitem, it have the same problem.
IMO, i expect it show selected radio or checkbox even they were disabled.
Ryan I agree, it seems to be more logical to show selected items even if they are disabled.
With your test case it is even more obvious that it makes no sense the actual behaviour of ZK.
Maybe anyone from ZK could tell us if this is planned to change?
Will.
There is a ticket in the bugtracker regarding this issue:
http://tracker.zkoss.org/browse/ZK-205
Asked: 2011-07-06 03:21:00 +0800
Seen: 340 times
Last updated: Aug 04 '11