0

Showing disabled and selected treeitems

asked 2011-07-06 03:21:00 +0800

gsim gravatar image gsim
81

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.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2011-07-07 01:47:35 +0800

gsim gravatar image gsim
81

So what do you think... is this a bug in ZK?

We need a consistent way of showing disabled selected items in a tree

link publish delete flag offensive edit

answered 2011-07-10 22:22:11 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

updated 2011-07-10 22:23:21 +0800

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.


my test case

link publish delete flag offensive edit

answered 2011-07-11 02:24:01 +0800

gsim gravatar image gsim
81

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.

link publish delete flag offensive edit

answered 2011-07-14 09:46:09 +0800

gsim gravatar image gsim
81

Is anyone out there that can enlighten us about this?

link publish delete flag offensive edit

answered 2011-08-04 05:06:18 +0800

cypha gravatar image cypha
27 1

updated 2011-08-04 05:06:33 +0800

There is a ticket in the bugtracker regarding this issue:
http://tracker.zkoss.org/browse/ZK-205

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-07-06 03:21:00 +0800

Seen: 340 times

Last updated: Aug 04 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More