0

Access Arguments from Execute.createComponents

asked 2020-10-08 17:04:48 +0800

RomanZK gravatar image RomanZK
1

I am using the Executions.createComponents method to include a zul page.

I intend to pass args to the included page. The included page is bound to a ViewModel class.

How can I access the args parameter ?

see code snippets below ...

Map args = new HashMap();

Executions.createComponents("mypage.zul", args)

then

MyViewModel

@Init public void init(@ExecutionArgParam("args") Map args) { logger.info("-------- NewContactVM init ----------");

        this.arg = args;


        if (arg != null)
        {
            logger.info(" args is not null oh !. size: " + arg.size());
        }
        else
        {
            logger.info(" args is null oh !  ");
        }


 }

From my test the args parameter is null.

 Remember that I am doing the include programmatically. How can this be achieved ?
delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2020-10-14 17:33:54 +0800

cor3000 gravatar image cor3000
5399 2 7
ZK Team

here a runnable example which works up to 9.1.0 ...

we are investigating what's wrong in 9.5.0

link publish delete flag offensive edit

answered 2020-10-14 17:45:07 +0800

MDuchemin gravatar image MDuchemin
1758 1 5
ZK Team

Hi there!

The code from cor3000 fiddle is good, but fiddle is having a bad time processing it in ZK 9.5 at the current time. Here's the relevant bug for reference.

link publish delete flag offensive edit

answered 2020-10-14 18:38:42 +0800

RomanZK gravatar image RomanZK
1

Thanks for this. I am currently on version 9.0.0.1.

Please let us know when this is fixed in the latest version.

link publish delete flag offensive edit

answered 2020-10-19 18:02:40 +0800

MDuchemin gravatar image MDuchemin
1758 1 5
ZK Team

https://tracker.zkoss.org/browse/ZK-4698 underlying issue fixed in 9.5.1

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
2 followers

RSS

Stats

Asked: 2020-10-08 17:04:48 +0800

Seen: 10 times

Last updated: 11 hours ago

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