Revision history [back]

Inline Macro: pass parameter with ViewModel annotation (@load(x))

I try to pass a binding annotation as a parameter to a macro:

<?component name="macro" inline="true" macroURI="macro.zul"?> <zk>
<window title="Macro Test"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('de.klauswr.zk.MacroViewModel')">

<macro value="@bind(vm.field)" />

</window> </zk>


where macro.zul:

<hlayout>
<textbox value="${arg.value}" /> </hlayout>  But I always get an empty result for the macro, while the label properly renders "Test" as initial value for "field". I fiddled around with thousands of permutations but never got a proper result. This macro is just a short test for a bit complexer macro i need to use over and over in order to get a unique layout for certain data entry screens so please do not just post an answer for this simple example but help me solve the @()-binding issue. Inline Macro: pass parameter with ViewModel annotation (@load(x)) I try to pass a binding annotation as a parameter to a macro: <?component name="macro" inline="true" macroURI="macro.zul"?> macroURI="macro.zul"?>  <zk> <window title="Macro Test" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('de.klauswr.zk.MacroViewModel')"> viewmodel="@id('vm') @init('de.klauswr.zk.MacroViewModel')">  <label value="@load(vm.field)" /> <macro value="@bind(vm.field)" /> </window> </zk> </window>  </zk> where macro.zul: <hlayout> <textbox value="${arg.value}" />
</hlayout>


But I always get an empty result for the macro, while the label properly renders "Test" as initial value for "field". I fiddled around with thousands of permutations but never got a proper result.

This macro is just a short test for a bit complexer macro i need to use over and over in order to get a unique layout for certain data entry screens so please do not just post an answer for this simple example but help me solve the @()-binding issue.

Inline Macro: pass parameter with ViewModel annotation (@load(x))

I try to pass a binding annotation as a parameter to a macro:

<?component name="macro" inline="true" macroURI="macro.zul"?>


<zk> <window title="Macro Test" apply="org.zkoss.bind.BindComposer" viewmodel="@id('vm') @init('de.klauswr.zk.MacroViewModel')">


viewModel="@id('vm') @init('de.klauswr.zk.MacroViewModel')">

<macro value="@bind(vm.field)" />

</window>
</window>
</zk>


</zk>

where macro.zul:

<hlayout>
<textbox value="${arg.value}" /> </hlayout>  But I always get an empty result for the macro, while the label properly renders "Test" as initial value for "field". I fiddled around with thousands of permutations but never got a proper result. This macro is just a short test for a bit complexer macro i need to use over and over in order to get a unique layout for certain data entry screens so please do not just post an answer for this simple example but help me solve the @()-binding issue. Inline Macro: pass parameter with ViewModel annotation (@load(x)) I try to pass a binding annotation as a parameter to a macro: <?component name="macro" inline="true" macroURI="macro.zul"?> <zk> <window title="Macro Test" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('de.klauswr.zk.MacroViewModel')"> <label value="@load(vm.field)" /> <macro value="@bind(vm.field)" /> </window> </zk>  where macro.zul: <hlayout> <textbox value="${arg.value}" />
</hlayout>


But I always get an empty result for the macro, while the label properly renders "Test" as initial value for "field". I fiddled around with thousands of permutations but never got a proper result.

This macro is just a short test for a bit complexer macro i need to use over and over in order to get a unique layout for certain data entry screens so please do not just post an answer for this simple example but help me solve the @()-binding issue.

Support Options
• Email Support
• Training
• Consulting
• Outsourcing