-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I was wondering if there is a way to directly operate on the middle object of a form. In my use case, I want to dynamically add data rows to my entity. If the user cancels th operation, however, the added rows should be discarded. Currently the middle object seems not event to contain the current list of data rows that are stored in the entity. If a use the following code, no rows are shown although the entity contains two rows:
<groupbox form="@id('prn') @load(vm.workItemPRNummer) @save(vm.workItemPRNummer, before='addTranslation') @save(vm.workItemPRNummer, before='deleteTranslation') > <grid> <columns> <column label="Sprache"/> </columns> <rows children="@load(prn.uebersetzungen)"> <template name="children" var="item"> <row> <textbox value="@bind(item.sprache)" cols="2"></textbox> </row> </template> </rows> </grid>
If I replace the code to load the list property ('uebersetzungen') from the view model directly
<rows children="@load(vm.workItemPRNummer.uebersetzungen)">
What I really want however, is that the list of data rows is provided by the middle object and that I can add/delete rows from the middle object and have the changes written to the backing object once the user saves the form.
An I overlooking something here?
B.
Hi batman256,
It seems a bug of zkbind, when you use children bind in a form, for now you can use model binding to instead of children bind.
<groupbox form="@id('prn') @load(vm.workItemPRNummer)" >
<grid model="@load(prn.uebersetzungen)">
<columns>
<column label="Sprache" />
</columns>
<template name="model" var="item">
<row>
<textbox value="@bind(item.sprache)"
cols="2">
</textbox>
</row>
</template>
</grid>
Asked: 2013-01-20 08:51:07 +0800
Seen: 28 times
Last updated: Feb 07 '13