0

calling function from inside embedded window

asked 2006-03-19 06:16:58 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3637667

By: rob_chou

I have a window embedded multiple times (via createComponents) inside an outer window.

In the embedded window(s), I'd like to call functions defined in the outer window.

Any clues?

thanks,
rob

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2006-03-19 07:09:25 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3637705

By: rob_chou

sort of working using the following, but is there a way to get an instance of "bsh.Interpreter"?

Window outerWindow = target.getPage().getFellow( "windowName" );
ns = outerWindow.getNameSpace();
interp = new bsh.Interpreter();
ns.invokeMethod( "test", null, interp );


link publish delete flag offensive edit

answered 2006-03-19 07:45:49 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3637722

By: tomyeh

No, it is not recommended to get the interpreter (ZK might change the interpreter in the future).
Rather, you might use Page.interpret().

To invoke a method of window (in zscript), you simply call it directly:

Path.getComponent("/windowName").test();

link publish delete flag offensive edit

answered 2006-03-20 00:02:41 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3638604

By: nobody

I didn't subclass window yet, just defined a function using bsh so the "Path...test()" failed with no function defined. I'm just prototyping (really the attractive part of zk) before refactoring code to classes...

thanks,
rob

link publish delete flag offensive edit

answered 2006-03-20 02:07:13 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3638712

By: tomyeh

Then, you have to post more codes to illustrate the issue.

link publish delete flag offensive edit

answered 2006-04-12 08:34:05 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3682614

By: nobody

Hi,

I have the same toolbar button in several Window. Is it possible to put this toolbar Button in a function and call this function?

HOw can I do this?

Regards,

link publish delete flag offensive edit

answered 2006-04-12 09:28:16 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3682693

By: henrichen

We are implementing a macro mechanism that would allow developers to "macro define" a component in a zuml page and use it later as a simple component. I guess that would fit your needs.

Another way is to construct your toolbar buttons in a java methods and you can call that method to attach the toolbar buttons into your each Window.

/henri


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: 2006-03-19 06:16:58 +0800

Seen: 320 times

Last updated: Apr 12 '06

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