-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I know this is a newbie question but it's hard to find any documentation associated with that.
I have two windows in my app. They both use the same controller. Now I want to click on a button of one window and display some value in a textbox of another window. How can I do this? Is there a pattern I can use?
I've tried to put the textbox as an autowired component but it seems it couldn't find that component which is in another window.
Could you provide zul to clarify the problem ? ^^
<window id="A1" apply="MyController"> <button id="B"></button> </window> <window id="A2" apply="MyController"> <textbox id="C"></textbox> </window>
What I want to do is click button B and change the value of textbox C. How can I do that?
what if I want to set the value on the server side?
You could try this statement in controller to get C .
Path.getComponent("/A2/C")
Some notes/variants:
1.) Use the absoulte path (as TonyQ wrote)
2.) You could avoid (inline) window and use components without own namespace (div, panel, groupbox..)
3.) Mixed with java, you could use autowired utitiy.
i.e. use an GenericForwardComposer for the root UI-Namespace
and add the subnamespaces via
Components.wireVariables(a2, rootComposer); //
/Robert
Asked: 2010-08-22 19:41:25 +0800
Seen: 451 times
Last updated: Aug 23 '10