-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
First, sorry for my english, I'm belgian.
ZK version : 5.0.1 (maven)
explorer : chrome
I have a combobox with autodrop filled by databinding. I want to fill the list only after the second character in the box (big list in DB). So, when I put one character in the box, the autodrop open a empty list. When I put the second character, the databinding runs and fill the list. The problem comes here, the list has more than one result but the list size doesn't change (one result) and another arrow appears. like that. How could I refresh the list's size ?
This is the relevant part of my controller :
public void onChanging$villeCB(InputEvent evt) {
try {
String search = evt.getValue().replace(" ", "");
if (search.length() >= 2) {
modelVille = new ArrayList<Ville>();
List<Ville> listVille = villeManager.findLike(search + "*");
if (listVille != null && listVille.size() > 0) {
modelVille.addAll(listVille);
}
}
} catch (WrongValueException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
}
And the zul :
<combobox id="villeCB" model="@{mainCtrl.modelVille, load-after='self.onChanging'}"
selectedItem="@{mainCtrl.selectedVille}" cols="50">
<comboitem self="@{each=ville}" label="@{ville.nom}" value="@{ville.id}" />
</combobox>
Thanks for any help !
modelVille.addAll(listVille);
binder.loadAll();
Thanks for the reply but the load is done in zul : load-after='self.onChanging'. That's not the problem. If you see at the picture, you will remark the double arrow for the combobox.
In fact, I would like to resize the list of the combobox after the load of the datas and keep the autodrop.
Ok, I resolved the problem by deleting the 'autodrop="true"' in zul file and add a villeCB.open() after modelVille.addAll(listVille) in my controller.
Asked: 2010-11-10 15:06:15 +0800
Seen: 456 times
Last updated: Nov 11 '10