-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a textbox :
<textbox id="tb"/>
A listbox (with a query, but it's not important):
<listbox id="someList"
model="@{query.Leftlist.childrenQuery, access='load', load-after='tb.onChange'}"/>
And a method in Java in the Controller class of the above mentioned elements:
public void doSomething() {
//do something after the listbox has finished loading
}
How do I load/execute the doSomething() method after the listbox finished loading?
Hello!
<zk>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="win"?>
<window id="win" title="Container Window" border="normal" apply="test01.test.TestController">
<textbox id="tb" />
<listbox id="lb" model="@{win$composer.dataModel, load-after='tb.onChange'}">
<listhead>
<listheader label="Value" />
</listhead>
</listbox>
</window>
</zk>
where the TextController is a simple:
public class TestController extends GenericForwardComposer {
public ListModel<String> getDataModel() {
System.out.println("reloading the data model...");
return new ListModelList<String>(new String[] {"one", "two", "three"});
}
}
Something like this? If you want to be pure MVVM instead, i think you can find good inspiration on BenBai's blog: http://ben-bai.blogspot.lu/2012/12/zk-listbox-inplace-editing-with.html where he is using a onModelDataChange custom Event in a different scenario.
Giovanni
Asked: 2016-02-17 13:48:43 +0800
Seen: 24 times
Last updated: Feb 17 '16