# passing present viewmodel to included page. [closed]

nsharma
917 1 11

Hello,here is a weird situation, and guess i have tried everything what i think should have worked.

look below the code first ,in this i have taken a groupbox and a div in vlayout,In div their is a include component,I want to pass the present viewModel object(vm) to the viewmodel of this included page.

    <window mode="modal" popup="true" width="1000px" height="635px"
closable="true"
apply="org.zkoss.bind.BindComposer" border="normal"
position="center,top"
viewModel="@id('vm') @init('xxx.ViewModel')">
<vlayout>
<groupbox width="100%" mold="3d" height="280px"
closable="false">
<caption>
............
</groupbox>
<div>
<include   src="@bind(vm.path)"
</include>
</div>
</vlayout>

</window>
</zk>


included page viewmodel code:

   @AfterCompose
public void afterCompose(@ExecutionParam("viewModelArg") ViewModel viewModel  ){}


initially somehow it was working ,but as i have changed some code inside my project(don't have any idea about the change,but its not relative as much i know to this code),Now it has stopped working.and gives a null value to viewModel.

The situation is that ,we can have only string type value and for non string-typed their is no clear documentation about how to retrieve the value in included page viewmodel.I get a NULL everytime. Thanks in advance.

delete retag edit