zk - Combining ZUML EL Expression with Binding - Stack Overflow

There is two different usages of EL constructs in ZK. One for page construction (ZUML) and one for bind

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!!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744333649a4569007.html

相关推荐

  • zk - Combining ZUML EL Expression with Binding - Stack Overflow

    There is two different usages of EL constructs in ZK. One for page construction (ZUML) and one for bind

    7天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信