Revision history [back]

click to hide/show revision 1
initial version

asked 2010-11-10 15:06:15 +0800

gaiol gravatar image gaiol

Combobox, databinding and autodrop


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="@{}"/> </combobox>

Thanks for any help !

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More