0

Howto pass event data back to server

asked 2010-07-15 11:28:11 +0800

cjfleck gravatar image cjfleck
60 1

Using zk5.0.3

I'm trying to initiate an event using client side javascript and pass data back to the server. So far, I have been successful in initiating the event, but not in passing the data. Perhaps someone can help...

As as example, the following is the javascript call to kick off the event...

zAu.send(new zk.Event(this.$f('myTb'), 'onChange',[1,2]));

In my server side java code, I handle the onChange event for this textbox and it does receive the event, however, the data property of the event is null.

How can I pass this data back to the server? Does a zk.Event get translated to a org.zkoss.zk.ui.event.Event appropriately here?

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-07-16 01:20:17 +0800

vinhvo gravatar image vinhvo
369 3

It is because it is translated to forward event which is not original event :
Sample code to get back original event :

public void onFilter(Event event){
		while (event.getData()==null){
			event=((ForwardEvent) event).getOrigin();
		}
		criteria=(Criteria) event.getData();
}

Hope that helps

link publish delete flag offensive edit

answered 2010-07-19 09:09:07 +0800

cjfleck gravatar image cjfleck
60 1

I tried that but no luck. The original event is an inputevent, but getData returns null. Any other ideas?

link publish delete flag offensive edit

answered 2010-07-20 21:28:21 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

http://www.zkoss.org/javadoc/5.0.1/zk/org/zkoss/zk/ui/event/InputEvent.html#getValue%28%29

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: 2010-07-15 11:28:11 +0800

Seen: 495 times

Last updated: Jul 20 '10

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