-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Combobox with autodrop="true"
and no initial value selected.
When I type a value that is at the bottom of the list:
- using ZK-7 or ZK-6.5.7 combobox don´t scroll to see the matching value;
- instead using ZK-3.6.4 work well and the list scroll to see the matching value.
Run the following sample and typing "4" in the combobox:
<zk>
<combobox autodrop="true" >
<comboitem label="a" />
<comboitem label="b" />
<comboitem label="c" />
<comboitem label="d" />
<comboitem label="e" />
<comboitem label="f" />
<comboitem label="g" />
<comboitem label="h" />
<comboitem label="i" />
<comboitem label="l" />
<comboitem label="m" />
<comboitem label="n" />
<comboitem label="o" />
<comboitem label="p" />
<comboitem label="q" />
<comboitem label="r" />
<comboitem label="s" />
<comboitem label="t" />
<comboitem label="u" />
<comboitem label="v" />
<comboitem label="x" />
<comboitem label="y" />
<comboitem label="z" />
<comboitem label="A" />
<comboitem label="B" />
<comboitem label="C" />
<comboitem label="D" />
<comboitem label="E" />
<comboitem label="F" />
<comboitem label="G" />
<comboitem label="H" />
<comboitem label="I" />
<comboitem label="L" />
<comboitem label="M" />
<comboitem label="N" />
<comboitem label="O" />
<comboitem label="P" />
<comboitem label="Q" />
<comboitem label="1" />
<comboitem label="2" />
<comboitem label="3" />
<comboitem label="4" />
<comboitem label="5" />
<comboitem label="6" />
<comboitem label="7" />
<comboitem label="8" />
</combobox>
</zk>
Note:
Hello
Try setting your list model on the fly rather than hard coding them that way you will get the desired result.
<combobox autodrop="true" id="combo"/>
<zscript>
String[] _dict = {
"A","B","C","D","E","F","G","H","I","J","K","L","M","N",
"O","P","Q","R","S","T","U","V","a","b","c","d","e","f",
"g","h","i","j","k","l","m","n","o","p","q","r","s","t",
"u","v","1","2","3","4","5","6","7","8","9",
};
ListModel dictModel= new SimpleListModel(_dict);
combo.setModel(dictModel);
</zscript>
Thanks echarish, your sample work well but I can to see the only item selected so how drops down the list of combo items to see also the other items like ZK3.6.4?
Asked: 2015-04-22 11:15:10 +0800
Seen: 17 times
Last updated: Apr 23 '15