+1 Chill. This is a very nice but overlooked feature of the framework
cyiannoulis ( 2015-01-09 09:48:39 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi. I'm working with zk 7 mvvm approach. Currently, I want to bind a getter property with a parameter and I receive the following error:
Unable to find method [availableQuantity] with [1] parameters at [file:/D:/Inventia/Local/07-Proyectos/Lince/04-Desarrollo/Repository/branches/master/src/lince-ui-web/lince-ui-web/src/main/webapp/views/warehouse/inventory/manage-input-inventory-movements.zul, line:349]...
Caused by: org.zkoss.zel.MethodNotFoundException: Unable to find method [availableQuantity] with [1] parameters
at org.zkoss.zel.BeanELResolver.invoke(BeanELResolver.java:542) ~[zel-7.0.3.jar:7.0.3]
at org.zkoss.zel.CompositeELResolver.invoke(CompositeELResolver.java:154) ~[zel-7.0.3.jar:7.0.3]
at org.zkoss.xel.zel.XelELResolver.invoke(XelELResolver.java:148) ~[zcommon-7.0.3.jar:7.0.3]
at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:166) ~[zel-7.0.3.jar:7.0.3]
at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) ~[zel-7.0.3.jar:7.0.3]
at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:40) ~[zcommon-7.0.3.jar:7.0.3]
at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:46) ~[zkbind-7.0.3.jar:7.0.3]
Here is my view block extract:
<groupbox form="@id('fx') @load(vm) @save(vm.inventoryMovementToolItems, before={'save', 'addToolInventoryItem', 'markManagedInstanceAsDirty'}) @validator(vm.inventoryItemsValidator)">
<caption label="${labels.feature.manageInputInventoryMovements.tool.title}" />
<grid hflex="1" model="@bind(fx.inventoryMovementToolItems)">
.....
<cell>
<intbox hflex="1" readonly="true" value="**@load(each.inventoryItem.material.availableQuantity(vm.managedInstance.warehouse))**">
</intbox>
</cell>
....
vm.managedInstance is the instance being managed in a Crud operation and availableQuantity is a getter property which calculates a value based on the passed parameter. Any ideas how to solve it?. Thanks in advance!
It's simpel.
You have to call the fully name of the getter cause you are using the ()
.
each.inventoryItem
is a shortcut for each.getInventoryItem()
.
Solution :
value="@load(each.inventoryItem.material.getAvailableQuantity(vm.managedInstance.warehouse))">
Greetz chill.
+1 Chill. This is a very nice but overlooked feature of the framework
cyiannoulis ( 2015-01-09 09:48:39 +0800 )editTried doing that with passing the forEachStatus.index but couldn't get it to work.
Asked: 2015-01-08 23:40:40 +0800
Seen: 78 times
Last updated: Nov 23 '15