-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have three controllers:
MainController ControllerA ControllerB
MainController creates a Window:
...
final Map<String, java.lang.Object> args = new HashMap<>();
args.put("mydata", "whatever");
Window myWindow = (Window)Executions.createComponents("a.zul", null, args);
....
a.zul only includes b.zul:
<include src="b.zul"/>
I can read "args" just fine form ControllerA using either @ExecutionArgParam or Executions.getCurrent().getArg().get("mydata") but from ControllerB I cannot.
How can I read the value of "args" in ControllerB.
Hi tisaksen,
I created a zk fiddle example that shows what happens to the execution arguments used when creating components.
The include component will create a nested execution with its own arguments. If you want to pass on parameters you can set a dynamic property on the include:
<include mydata="${arg.mydata}" src="b.zul"/>
see: http://zkfiddle.org/sample/vi8pd8/1-nesting-execution-arguments#source-3
When removing that property b.zul won't be able to display the "mydata".
If my example doesn't match your case please feel free to update the fiddle example, and post a link here. At the moment I am not sure if you are using MVVM, MVC or a mix of both patterns.
Robert
Asked: 2017-11-03 21:03:50 +0800
Seen: 33 times
Last updated: Nov 07 '17
did you try set the mode to defer for b.zul?
chillworld ( 2017-11-03 21:55:28 +0800 )editI tried setting mode="defer" but I don't see any difference.
tisaksen ( 2017-11-06 19:09:29 +0800 )edit