0

call applet method from composer with invoke

asked 2010-08-26 06:19:40 +0800

moloch gravatar image moloch
606 1 13

updated 2010-08-26 07:42:22 +0800

Hello,
is it possible to call a applet method from the composer like this? because in the documentation i see it only in the zul page
and this way brings me always the message "method not found" :

	public void onClick$GetID_Btn(Event event)  {
		try {
			this.myApplet.invoke("GetID(name)");
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}



but when i call the applet method directly from the zul page it works. but i want to use the composer:

<script type="text/javascript">
		 function GetID(){
			var appletReturn=new Object();
			var applet = document.getElementsByTagName("applet")[0]; 
			appletReturn = applet.js_GetID('getIDCallbackMethod');

		}


		function getIDCallbackMethod(value){
			alert("returnValue:"+value);
			
		}

</script>

...
<button label="button" xmlns:w="http://www.zkoss.org/2005/zk/client" w:onClick="GetID()"/>

Please help.
Greets

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-08-26 07:42:38 +0800

moloch gravatar image moloch
606 1 13

ok it works

link publish delete flag offensive edit

answered 2010-09-20 04:49:40 +0800

asgar gravatar image asgar
132 1 3

can you please tell me how it works???

link publish delete flag offensive edit

answered 2010-09-21 01:17:31 +0800

moloch gravatar image moloch
606 1 13

my fault was in this line

this.myApplet.invoke("GetID(name)");

because params you have to send like this!

this.myApplet.invoke("GetID", "name");

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-08-26 06:19:40 +0800

Seen: 726 times

Last updated: Sep 21 '10

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