0

Event Handling on listbox

asked 2014-03-27 09:19:32 +0800

tejal gravatar image tejal
1

updated 2014-03-27 15:44:35 +0800

sitansu gravatar image sitansu
2254 13
http://java91.blogspot.in...

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

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-03-27 09:57:29 +0800

sitansu gravatar image sitansu
2254 13
http://java91.blogspot.in...

updated 2014-03-27 10:00:06 +0800

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

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2014-03-27 09:19:32 +0800

Seen: 22 times

Last updated: Mar 27 '14

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