-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I am try to set up two listboxes for drag and drop. The problem is the left hand side of this is tabbox (accordion) of listboxes. The only thing a cannot get to work is the updating of the listboxes in the tabbox. My zul code is as follows:
<tabbox mold="accordion">
<tabs children="@load(vm.topLevelNav)">
<template name="children" var="topLevel">
<tab label="@load(topLevel.name)"/>
</template>
</tabs>
<tabpanels children="@load(vm.topLevelNav)">
<template name="children" var="parent">
<tabpanel>
<listbox model="@bind(parent.children)" droppable="true">
<template name="model" var="navItem">
<authListItem draggable="true" navItem="@bind(navItem)">
<listcell label="@bind(navItem.name)"/>
</authListItem>
</template>
</listbox>
</tabpanel>
</template>
</tabpanels>
</tabbox>
The problem is when I modify the children of an object in the topLevelNav collection, the listbox does not refresh. How do I make this happen ?
It is like I need the listbox inside the tab panel to have another View Model.
Any help here would be great, been stuck on this for a while.
Thanks.
I found the solution to this one. I mis-understood how the notifyChange annotation worked. In the end I needed to implicitly update the children property in my ViewModel when a change was made:
BindUtils.postNotifyChange(null,null,this,"children");
Asked: 2013-05-14 06:14:53 +0800
Seen: 18 times
Last updated: May 15 '13