-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi Everyone,
I'm using one div and added onClick eventlistener. this event is working fine, when we click the div.
My problem if some time i need to fire the div onClick event automatically with out clicking from ui. how can i fire an event.
i have tried div.fireEvent("onClick") it is not working. i'm using zk .3.5.6 version
Thanks in Advance
Thiru
I don't know if thats possible, but even if it is there should be a better solution.
If you have a method onClick$idofthediv(ForwwardEvent event) in your controller and you need the code inside to be executed in other cases too, then you should just do
onClick$idofthediv() {
doSomething()
}
doSomething() {
....
}
So from your other method you can just call the doSomething() method and you get the same result.
Yeah, TOtte, it's the preferred way.
But sometimes, you need to fire an event. Look at Events.postEvent(..). But it's better to avoid that.
Asked: 2010-02-15 04:25:35 +0800
Seen: 1,931 times
Last updated: Feb 18 '10