This issue only happened on PE/CE version, please try EE version. And it is also not suggest to have database transactions in view model getter.
vincentjian ( 2014-12-31 08:12:57 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
A few days ago i posted this question indicating a possible bug related to the MVVM bind mechanism. The problem is that under certain circumstances a getter may be called multiple times, causing serious performance problems.
I created a simple ZKFiddle example with two pages. When the user selects one of the names on the main list the second page is loaded saying that the method getPositions() was called 6 times!
I am attaching a snapshot image from my machine:
The problem is that on the ZKFiddle site everything works fine! I have tried the same example with many zk versions (7.0, 7.0.2, 7.0.3) both CE and PE editions having the same results on our machines.
Is there any possibility anyone of you to try the same zkfiddle code on his/her machine?
I am using:
Chrome 37.0.2062.124 m / Firefox 32.0.3
Eclipse version: 4.3.2.v20140221-1852 Build id: M20140221-1700
Windows 7
Thanks a lot for any help
Costas
I am trying your example and it is saying called single time see attached image
EDIT:
Above tested on Fiddle now i am testing in local machine
EDIT:-
Tested your code in local machine get method is called 6 times
I think it is getting worse... in my sample page2.zul if you move the selectbox declaration outside of the grid (lets say at the beginning of the page) then the getter is getting called only once!!
Position
<selectbox model="@load(vm.positions)" >
<template name="model" var="position" >
<label value="@load(position)" />
</template>
</selectbox>
<div width="100%" >
<vlayout>
<grid hflex="true">
<columns>
<column width="200px" />
<column hflex="1" />
</columns>
<rows>
<row>Name
<textbox value="@bind(vm.person.name)" />
</row>
</rows>
</grid>
<button label="Save" onClick="@command('save')" />
</vlayout>
</div>
Costas
This issue only happened on PE/CE version, please try EE version. And it is also not suggest to have database transactions in view model getter.
vincentjian ( 2014-12-31 08:12:57 +0800 )editBut still not get it. PE is a payable version of ZK correct? And since it offers Data Binding out-of-the-box why do i have to buy the EE package to correct this problem? It is not a feature. It is a bug.
As for the getters, i agree they should not call database transactions.
Costas
Asked: 2014-09-25 13:10:41 +0800
Seen: 41 times
Last updated: Dec 31 '14
Problem binding values to a composite component
How to access static member field of a class in zul without zscript
How can i load a constant in .zul
MVVM Validator: class not found ? [closed]
MVVM tab box - delay @load until tab pane displayed?
mvvm, load or save with after or before for seach command
how to fire an event when a variable value loaded through VM
is there any event trigger from zk component on binding ?
ZK team plans to dispose of Composer EventQueues no longer in scope? [closed]
A possible workaround is using listbox with "select" mold.
vincentjian ( 2014-09-29 02:18:38 +0800 )editNope! Same thing either using selectbox or listbox. I dought this issue is related to the component. It must be something with the binder.
cyiannoulis ( 2014-09-30 09:03:05 +0800 )edit