1

How to call server-side method from client?

asked 2015-04-24 08:55:35 +0800

tisaksen gravatar image tisaksen
46 6

Hi, I'm trying to have a javascript function trigger a server-side event:

function whatever() { zAu.send(this, 'onWhatever', null); }

on the server-side i have a composer with the following:

public void doAfterCompose(Component comp) throws Exception { comp.addEventListener("onWhatever", new EventListener() { @Override public void onEvent(Event event) throws Exception { Messagebox.show("Epic!"); } }); }

It's not working at all, client hangs. Ideas?

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2015-04-24 12:46:26 +0800

tisaksen gravatar image tisaksen
46 6

Thank you! I was missing the component id as well (instead of 'this')

link publish delete flag offensive edit

Comments

your welcome.

chillworld ( 2015-04-24 12:50:25 +0800 )edit
0

answered 2015-04-24 11:33:09 +0800

bubler gravatar image bubler
1
http://www.moja-skarbonka...

good job, thanks

link publish delete flag offensive edit
1

answered 2015-04-24 09:06:24 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Try :

zAu.send(new zk.Event(zk.Widget.$(this), 'onWhatever',[1,2]));

Link to source.

Greetz chill.

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: 2015-04-24 08:55:35 +0800

Seen: 32 times

Last updated: Apr 24 '15

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