0 Replies Latest reply on Sep 27, 2010 10:09 AM by Arsohoh

    Stopping Event Propagation


      Hi All,


      Am facing some issue in event propagation.


      I have a Application component with in which I have a link button. The Application has a mouseDown event listening for it and the link button has the click event listening for it.


      I have a requirement where in if i click on the link button i got to show an image and on again clicking on the link button hiding the image. Basically toggling the hide/show of image on click of the link button. This works fine as expected.


      Now I have mouseDown listening on the Application, where in If I click any where else in the Application again the Image show be hidden and only on click of Link button it should be shown.


      But since I have the mouseDown listening on the Application, whenever I click on the Link button the image is showing properly but then after that when I click the link button again to hide the image, then since two events are getting triggered  the Image is never getting hidden. It always shows up.


      THE FIX I NEED is that when i click on the link button, the parent event should be stopped from bubbling and hence only the Link Button's Click should be called and not the Application's mouseDown.. And in else other places, its fine to have the Application's mouseDown event called.


      I Tried event.stopPropagation () and event.stopImme()...but in vain.......... PLS HELP