admin管理员组文章数量:1402949
There is two different usages of EL constructs in ZK. One for page construction (ZUML) and one for binding. I understand that the former is evaluated before the latter and so one has to be careful mixing them. However, it seems it should be possible to use ZUML EL to construct binding expressions. Specifically, I would like to make something like this work:
<vbox vflex="1" viewModel="@id('vm')@init(arg.viewModel)"
hflex="1" style="margin-top:1em">
<zk forEach="${vm.indexes}">
<button label="Button ${each}" onClick="@command(vm.click(${each}))" />
</zk>
</vbox>
where indexes is, say, 0...4. It should render 5 buttons "Button 0" to "Button 4" and when clicking on a button the click method on the view model would be called with the corresponding integer.
When trying however I get .zkoss.zel.ELException: Failed to parse the expression [${vm.click(${each})}]
.
The problematic part is the bind expression in onClick. Leaving that out gets me the buttons, so that the actual iteration on construction works, I just cannot the the binding expression generated.
Thanks for helping!!
本文标签: zkCombining ZUML EL Expression with BindingStack Overflow
版权声明:本文标题:zk - Combining ZUML EL Expression with Binding - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744333649a2601082.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论