0

Listbox with checkbox and label with Executions.sendRedirect()

asked 2012-05-30 01:52:13 +0800

RichardL gravatar image RichardL
768 4

Hi,
I have a listbox (ZK 6.0) with checkmark and multiple set to true, with one listcell in each listitem. In this listcell, I have a label with an onClick event listener to set a session variable and then Executions.sendRedirect().

Listbox (checkmark = true) -> Listitem -> Listcell -> Label (with Executions.sendRedirect() in event listener)

The problem is, when I click outside the label (anywhere in the listcell) the onClick event handler of the label is fired.

The intended behavior should be that the checkmark is checked if the user clicks on the listcell (anywhere outside of the label) and a redirect if the user clicks on the label.

I can't use a native hyperlink component instead of a label in this case as I need an event handler perform business logic.

Any ideas? (Is this a bug?)

Thanks,
Richard

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-05-31 03:27:42 +0800

RichardL gravatar image RichardL
768 4

* push *

link publish delete flag offensive edit

answered 2012-06-06 06:50:09 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

Hi Richard,

I've tried to reproduce this problem with the code fragment below on zk fiddle but cannot reproduce it,
could you provide a runnable sample that can reproduce this issue?

<zk>
	test
    <listbox checkmark="true" multiple="true">
    	<listitem>
    		<listcell>
    			<label value="label">
    				<attribute name="onClick">
    					Executions.sendRedirect("/test2.zul");
    				</attribute>
    			</label>
    		</listcell>
    	</listitem>
    </listbox>
</zk>

Thanks
Ben

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: 2012-05-30 01:52:13 +0800

Seen: 189 times

Last updated: Jun 06 '12

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