0

Button click in the java file

asked 2008-10-21 02:45:20 +0800

hello2222 gravatar image hello2222
103 3

I have a button in zul file, i want it to be clicked in a java file.
How can i do that???

something like Button save = new Button(); b.Click();

Thanks

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2008-10-21 04:21:40 +0800

robertlee gravatar image robertlee
561

updated 2008-10-21 04:22:27 +0800

Hi hello2222,
You can try using send Event or post event:
http://www.zkoss.org/doc/devguide/ch05s03.html

link publish delete flag offensive edit

answered 2008-10-21 07:34:09 +0800

hello2222 gravatar image hello2222
103 3

i use Events.sendEvent(getCancel(), new Event(Events.ON_CLICK, getCancel()));

But it says Callable only in the event listener

link publish delete flag offensive edit

answered 2008-10-22 01:15:49 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

try this

<window title="My First Window" border="normal" width="200px">
<button id="btn1" label="1st" onClick='alert("click "+self.label)'/>
<button id="btn2" label="2nd" onClick='alert("click "+self.label)'/>
<button label="post" onClick='Events.postEvent("onClick",btn1,null)'/>
</window>

link publish delete flag offensive edit

answered 2008-10-22 08:24:08 +0800

PeterKuo gravatar image PeterKuo
481 2

I think you can use <timer> component, postEvent in onTimer().

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2008-10-21 02:45:20 +0800

Seen: 395 times

Last updated: Oct 22 '08

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