0

Listbox right click on multiselect Listitem

asked 2010-10-08 18:41:16 +0800

khkim gravatar image khkim
18 2

Hi,

I am using ZK 5.0.4 upgrading from ZK 3.6.

I think the behavior of right click on the listitem is not working as before.
In ZK 5, when I have selected multi-items and right click on one of the item, it deselects all other selected items except the one right clicked.
Previous version, it did not deselect any item.

Even the behaviors of live demo and sandbox demo are different.
http://www.zkoss.org/zkdemo/listbox/multiple_selection
http://www.zkoss.org/zksandbox/userguide/#g9

Does anyone have any idea?
Thanks

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-10-11 19:53:33 +0800

samchuang gravatar image samchuang
4084 4

updated 2010-10-11 19:54:15 +0800

Hi

I tried ZK 5, it didn't deselects all other selected items, it only deselects itself

Which browser do you ues ? I tested on FF36

link publish delete flag offensive edit

answered 2010-10-12 08:33:26 +0800

khkim gravatar image khkim
18 2

Hi,

I used FF 3.6, too.
You can try this demo link.
http://www.zkoss.org/zksandbox/userguide/#g9
You select a few items and use right click on one of them.
Then only the right click one remaining. (If you right-click right on the check mark seems works as you mentioned.)

But somehow this demo link
http://www.zkoss.org/zkdemo/listbox/multiple_selection does not deselect other items.

Thanks

link publish delete flag offensive edit

answered 2010-10-13 20:27:14 +0800

samchuang gravatar image samchuang
4084 4

updated 2010-10-13 20:29:28 +0800

Hi,

I read release note about it

For listbox and tree, if checkmark is enabled, clicking an item will toggle
the selection rather than deselect all others.
If you want to deselect all others (as 5.0.4 or ealier did), please
specify true to library properties called
org.zkoss.zul.listbox.checkmarkDeselectOthers
and org.zkoss.zul.tree.checkmarkDeselectOthers

please refer to Library Properties

link publish delete flag offensive edit

answered 2010-10-21 17:07:41 +0800

khkim gravatar image khkim
18 2

Hi,

Thanks for your reply.
Looks like the release note you mentioned is 5.0.5 right?
So there is no other choices in v5.0.4?

Actually, in zk 3.6, right click was working better.
In 3.6, when I select multi-items and use right click to do some actions using menu popup, all the selected items stay the same.
I think that is the correct behavior for right click action. (for example, you select multiple files and try to copy them with right click, you don't want any file to be deselected.
Somehow, now in 5.0.4, right click action is treated almost same as left click action on multi select list.

I appreciate you taking some time to answer my question.

link publish delete flag offensive edit

answered 2010-10-21 22:59:07 +0800

samchuang gravatar image samchuang
4084 4

Hi

I think you are right, right click should not change select status, I post a feature request here

in zk 5.0.4, you can achieve by override javascript function

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
	<script><![CDATA[
	zk.afterLoad('zul.sel', function(){
	 	zul.sel.Listbox.prototype.shallIgnoreSelect_ = function (evt) {
	 		return evt.name == 'onRightClick';
	 	};
	});
	]]></script>
	<menupopup id="mmPP">
		<menuitem label="item 1" />
		<menuitem label="item 2" />
	</menupopup>
	<listbox checkmark="true" multiple="true">
		<listhead>
			<listheader label="header" sort="auto" />
		</listhead>
		<listitem context="mmPP">
			<listcell label="cell 1" />
		</listitem>
		<listitem  context="mmPP">
			<listcell label="cell 2" />
		</listitem>
		<listitem  context="mmPP">
			<listcell label="cell 3" />
		</listitem>
		<listitem  context="mmPP">
			<listcell label="cell 4" />
		</listitem>
	</listbox>
</zk>

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: 2010-10-08 18:41:16 +0800

Seen: 1,067 times

Last updated: Oct 21 '10

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