0

Nullpointerexception when getting param within include page

asked 2015-08-08 08:58:00 +0800

Yongquan gravatar image Yongquan
1 1

Hi,

I am trying to retrieve the param from the include page but always getting null

<include omg="@ref(vm.example)" src="demo3.zul"/>

viewModel="@id('vm') @init('com.demo.UI.demo3VM', example=omg)"

@Init public void init(@ExecutionArgParam("example") Example example){ System.out.println(example.getStrTitle()); System.out.println(example.getStrSubject()); }

anyone knows why?

delete flag offensive retag edit

Comments

Add this to the include : mode="defer" and hou dont have to pass it with hhe init of viewmodel.

chillworld ( 2015-08-08 12:24:43 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-08-17 06:47:17 +0800

vincentjian gravatar image vincentjian
2245 6

Hi,

You can retrieve the argument directly as follows:

<include omg="@ref(vm.example)" src="demo3.zul"/>

Then in demo3.zul

<window viewModel="@id('vm') @init('com.demo.UI.Demo3VM')">
</window>

Finally in demo3VM.java

@Init
public void init(@ExecutionArgParam("omg") Object example) {
    System.out.println(example);
}
link publish delete flag offensive 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: 2015-08-08 08:58:00 +0800

Seen: 21 times

Last updated: Aug 17 '15

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