-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, I am getting problem while handling event on Listbox. My Listbox item have one checkbox and one image and I want to handle onClick event on that image. As per my requirement after clicking on image, it should listen onClick event and checkbox should remain uncheck but when I click on image, checkbox is also get selected. It is working fine with button but giving problem to image. Checkbox, I mentioned above is a checkmark on listitem.
EXAMPLE:
<zk>
<window title="listbox demo" border="normal" width="250px" apply="TestComposer">
<listbox id="box" checkmark="true" multiple="true" >
<listhead sizable="true">
<listheader label="name" sort="auto" />
<listheader label="gender" sort="auto" />
</listhead>
<listitem>
<listcell label="Jane" />
<listcell>
<image id="deleteImg" src="/3dot.gif" ></image>
</listcell>
</listitem>
<listitem>
<listcell label="Henry" />
<listcell>
<button id="deletebtn" ></button>
</listcell>
</listitem>
</listbox>
In above example ,I have added onCLick event for both deleteimg and deletebtn. When I am clicking on button,it calls onClicklistner of deletebtn but when I am clicking on image then first,it calls onSelectlistner(which i havn't added explicitly) of listbox and then onClicklistner of image.So why it is calling onSelect event of listBox in case of image and what I have to do to stop this propagation?
ThankYou
I Try it in zk 7.0.1 its working fine:
<zk>
<window border="normal" title="hello" >
<checkbox id="ck"></checkbox>
<image src="/resource/image/greenbar-bar.gif" style="cursor:pointer" onClick="ck.checked=ck.checked?false:true"></image>
</window>
</zk>
See here:http://forum.zkoss.org/question/90702/checkbox-issues/#90714
Asked: 2014-03-27 09:19:32 +0800
Seen: 29 times
Last updated: Mar 27 '14