-
FEATURED COMPONENTS
First time here? Check out the FAQ!
m working on a ZK project using MVVM aproach , what i m trying to do is to show notification of a @bind(each.info) value but is not seems to work with me , here s what i have done so far.
<div width="59%" style=" float: left !important;" apply="org.zkoss.bind.BindComposer"
viewModel="@id('menu') @init('ma.schlemmer.headerbar.mainMenu')">
<hlayout children="@bind(menu.listMenu)">
<template name="children">
<a iconSclass="@bind(each.icon)" href="@bind(each.link)" autag="@bind(each.info)" onRightClick='Clients.showNotification("@bind(each.info)" ,"warning",this.self,"after_center",1000)'></a>
</template>
</hlayout>
</div>
and thank you
The declaration
onRightClick='Clients.showNotification("@bind(each.info)" ,"warning",this.self,"after_center",1000)'
is invalid because the EL expression "@bind(each.info)" cannot be parsed dynamically during the execution.
You can do this easily using a @command attribute:
<hlayout children="@bind(menu.listMenu)">
<template name="children">
<a iconSclass="@bind(each.icon)"
href="@bind(each.link)"
label="@bind(each.label)"
onRightClick="@command('showInfo', menuOption=each, parent=self)">
</a>
</template>
</hlayout>
and inside your view model implement the command:
@Command("showInfo")
public void onShowInfo(@BindingParam("menuOption") Menubean option, @BindingParam("parent") Component parent) {
Clients.showNotification(option.getInfo(), "warning", parent, "after_center", 1000);
}
Hope that helps
Costas
Asked: 2014-05-23 14:05:21 +0800
Seen: 30 times
Last updated: May 23 '14
Problem binding values to a composite component
How can i load a constant in .zul
MVVM Validator: class not found ? [closed]
[Ugent please] connect Web service .net view in grid group ZK
Dirty state for forms with collection properties
ZK drang and drop and databinding [closed]
Not able to bind Spring beans after zk upgrade
@cyiannoulis : thank you so much it works just perfectectly
elmetni ( 2014-05-23 16:09:03 +0800 )edit