Revision history [back]

click to hide/show revision 1
initial version

asked 2009-10-16 08:13:07 +0800

baskaraninfo gravatar image baskaraninfo

Problem using combobox auto-dropdown, when item label has more space in-between words.

When a combobox has more spaces in-between two words in an item label, then it trims it to a single space and sets in the combobox, when we navigate and press enter in the auto dropdown list of that particular item. But, when we type in the combobox, then it list properly considering the spaces appropriately.

Consider this item "ABC BUTTER SCHOOL PACK", which contains two spaces in-between ABC and BUTTER. When you type ABC and double space, then it lists the correct item as suggestion in auto dropdown list. But, without typing, if you navigate to that item in dropdown by pressing down arrow key, and select that item. Then it will be set as "ABC BUTTER SCHOOL PACK", where now ABC and BUTTER words are separated by a single space and not by a double space as expected.

Test code:

<?page title="Combo box with auto drop down" contentType="text/html;charset=UTF-8"?>
<zk>
    <window title="Combo box with auto drop down" border="normal">
        Auto-complete Combobox:
        <combobox id="combo" autodrop="true" buttonVisible="false"
            onChanging='result.text = self.getText()' />
        <zscript>
    String[] _dict = { "ABC  BUTTER SCHOOL PACK", "1 LIT SACHET SAGAR GHEE", "abacus", "accuracy",
            "acuity", "bird", "bingle", "blog", "cabane", "cape", "cease", "yea", "yellow", "zebra", "zk", };
    ListModel dictModel = new SimpleListModel(_dict);
    combo.setModel(dictModel);
</zscript>
    </window>
</zk>

I have reported a bug here.

Any suggestion to avoid this problem?

Thanks.

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