-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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?
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);
}
Asked: 2015-08-08 08:58:00 +0800
Seen: 21 times
Last updated: Aug 17 '15
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