asked
2015-02-02 09:03:42 +0800
KlausWr 37 ● 5 I tried to pass a form as parameter to a macro:
<?component name="mymacro" macroURI="mymacro.zul" inline="true"?>
...
<grid form="@id('fx') @load(vm) @save(vm), before='save'>
<rows>
<mymacro pojo="${fx}" field="myValue"/>
</rows>
</grid>
...
<button label="save" onClick="@command('save')" />
<button label="cancel" onClick="@command('cancel')" />
but I get "Target Unreachable, identifier 'pojo' resolved to null"
when I try to access this "passed form" in mymacro.zul:
<zk>
<row style="border: 1px solid red;">
<custom-attributes pojo="${arg.pojo}" field="${arg.field}"/>
Inside macro:
<textbox value="@bind(pojo[field])"/>
</row>
</zk>
See also discussion in Inline Macro: pass parameter with ViewModel annotation (@load(x))