0

Include and ExecutionArgParam

asked 2017-11-03 21:03:50 +0800

tisaksen gravatar image tisaksen
46 6

updated 2017-11-07 10:17:11 +0800

cor3000 gravatar image cor3000
6280 2 7

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.

delete flag offensive retag edit

Comments

did you try set the mode to defer for b.zul?

chillworld ( 2017-11-03 21:55:28 +0800 )edit

I tried setting mode="defer" but I don't see any difference.

tisaksen ( 2017-11-06 19:09:29 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-11-07 10:37:15 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2017-11-07 17:02:18 +0800

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

link publish delete flag offensive edit

Comments

Thanks a lot, this solved my issue :-)

tisaksen ( 2017-11-07 16:45:06 +0800 )edit
Your answer
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
1 follower

RSS

Stats

Asked: 2017-11-03 21:03:50 +0800

Seen: 33 times

Last updated: Nov 07 '17

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