-
FEATURED COMPONENTS
First time here? Check out the FAQ!
how to fire onClick event in the button using java code
Events.sendEvent(Events.ON_CLICK, yourButton, extraData);
is that what you meant? try to explain better your scenario otherwise :)
... this.button.addEventListener("onFocus", new EventListener() { public void onEvent(Event event) { foo(); } }); } ... this.button.setFocus(true);
saravanavel,
Here is an example of what gganassin said:
<zk> <zscript> import org.zkoss.zk.ui.util.GenericForwardComposer; public class MyController extends GenericForwardComposer { Button button1; public void onClickButton2(Event event) { Events.sendEvent(button1, new Event("onClick", button1)); } } </zscript> <window apply="MyController" style="padding: 15px;"> <button id="button1" label="Say Hello"> <attribute name="onClick"> alert("Hello there!"); </attribute> </button> <button label="Fire Event from Java" forward="onClick=onClickButton2()"/> </window> </zk>
Hope that helps,
Todd
HAI BRILLIANCE...
THANK YOU SO MUCH..I HAVE REACHED TO SOLVE MY PROBLEM. USING YOUR IMMEDIATE REPLY. THANK ALOT BRILLIANCE.
SPECIAL THANK TO *gganassin , zippy , twiegand*
BY SARAVANAVEL
Asked: 2011-12-09 13:29:36 +0800
Seen: 496 times
Last updated: Dec 10 '11