asked
2014-04-01 07:51:37 +0800
chillworld
5357 ● 4 ● 9
https://github.com/chillw...
Hi all,
I have a grid where I should go for each component to a webservice.
I get an object back but I need to show that object 2 times in the grid.
I don't want to fetch the stupid object twice cause I already got it and don't want to spoil network resource on that.
This is for the moment the grid :
<grid model="@load(vm.entries)" mold="paging" pageSize="@load(vm.pagingEntrySize)" pagingPosition="top" context="null" emptyMessage="No record retrieved">
<columns sizable="true" >
<column label="column1"/>
<column label="column2"/>
<column label="column3"/>
<column label="column4"/>
<column label="column5"/>
<column label="column6"/>
<column label="column7"/>
<column label="webserviceobject date" />
<column label="webserviceobject date2" />
</columns>
<template name="model" var="oe">
<row value="@id('fx') @load(vm.getMedicalExamination(oe))">
<label value="@load(oe.column1)"/>
<label value="@load(oe.column2)"/>
<label value="@load(oe.column3)"/>
<label value="@load(oe.column4)"/>
<label value="@load(vm.getcolumn5(oe))"/>
<label value="@load(oe.column6)" />
<label value="@load(oe.column7)" />
<label value="@load(fx.date)"/>
<label value="@load(fx.date2)"/>
</row>
</template>
</grid>
I remove all the relevant data but the problem is here :
I see in the logging that fx is being fetched once for each oe
But the binded label with fx.date and fx.date2 are not giving something.
I first set there this :
<label value="@load(fx eq null?'No info':fx.date)"/>
This always showed up No info. (in the logging from what I get from the webservice I clearly see that the dates are filled in so the object and the dates are not null)
So where is mine (stupid) fault? Row is the parent of the label so fx should be visible until the end tag.
Or do someone have an other solution/thought pure in the zul?
I know I can store a map in the vm, put oe as key and the object as value but that is just what I'm trying not to do (keep the vm simple and clean)
Greetz chill.