0

evnt fired by ZK Client Engine

asked 2009-04-24 15:28:58 +0800

issamlaabidi gravatar image issamlaabidi
217 2

please how i can make ZK Client Engine fire an event when the client close the browser it is so necessary for me.

delete flag offensive retag edit

16 Replies

Sort by ยป oldest newest

answered 2009-04-24 20:34:23 +0800

deved gravatar image deved
114 1

Hi,

The client:

function yourFunction(zkWindow) {
   comm.sendUser(zkWindow, "onBeforeBrowserClose", param1, param2, paramn);
}

The listener:
window.addEventListener("onUser", new EventListener() {
public void onEvent(Event e) {
  Object[] data = (Object[])e.getData();
  if(data[0].equals("onBeforeBrowserClose")) {
     //..do something
  }
  throw new IllegalArgumentException(data[0]);
}
});

Regards,

edgar

link publish delete flag offensive edit

answered 2009-04-26 14:46:52 +0800

naarani gravatar image naarani
33
www.blogstudiolegale.eu

how do I set the client function?

link publish delete flag offensive edit

answered 2009-04-26 21:10:28 +0800

deved gravatar image deved
114 1

Hi,
You can use the action attribute, for example:

<textbox <b >action</b>="onkeyup:yourFunction(#{self})"/>

For complete information take a look at CSA.

link publish delete flag offensive edit

answered 2009-04-26 21:27:11 +0800

naarani gravatar image naarani
33
www.blogstudiolegale.eu

I'm using Java not scripting, I'll check how this is translated to java code

link publish delete flag offensive edit

answered 2009-04-27 13:05:50 +0800

issamlaabidi gravatar image issamlaabidi
217 2

hi naarani please did you find how you use this in java i need it thanks

link publish delete flag offensive edit

answered 2009-04-27 13:19:06 +0800

issamlaabidi gravatar image issamlaabidi
217 2

Please how i can call the function " youFunction"?? please help

link publish delete flag offensive edit

answered 2009-04-27 13:22:21 +0800

issamlaabidi gravatar image issamlaabidi
217 2

Please what is the variable "comm" in the function "yourFuntion"

link publish delete flag offensive edit

answered 2009-04-27 15:18:20 +0800

deved gravatar image deved
114 1

Hi,
The comm variable is a zk object, take a look at the CSA documentation.

Regards,
edgar

link publish delete flag offensive edit

answered 2009-04-27 15:50:22 +0800

issamlaabidi gravatar image issamlaabidi
217 2

updated 2009-04-27 15:50:55 +0800

please the function "yourFuntion" i did not know where i put it, and param1 is not know for my javascript function

link publish delete flag offensive edit

answered 2009-04-27 16:25:24 +0800

deved gravatar image deved
114 1

Hi,
>>please how i can make ZK Client Engine fire an event when the client close the browser it is so necessary for me.
Did you have a js function to do that?
In this function you can call the comm.sendUser function. The param1 is an example to show you how send additional parameters to the zk listener (the Object[] data variable in the listener example), is not required if you don't have to send anything.

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: 2009-04-24 15:28:58 +0800

Seen: 332 times

Last updated: Apr 30 '09

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