Hi all,
I have implemented a ComboBoxItem which I can reuse as an auto suggest item...
And I'm using it like this...
It all works pretty well, the small issue I have it that if there's no matching criteria, then the options box is displayed displaying the text "No items to show". Now I changed that to "No suggestions" as you can see in my widgets code, however what I really want is for the box to not display at all if there are no options returned.
In the showcase, the combobox example () works this way so I'm hopeful it can be achieved, the only difference I can see between mine and the showcase is that I use a datasource whereas the showcase hardcodes some values into a data map.
What can I do to make it behave this way?, there's no setShowPickerListWhenEmpty(boolean) method or anything similar that I can see.
Thanks,
Dale
I have implemented a ComboBoxItem which I can reuse as an auto suggest item...
Code:
package com.serengetisystems.tcrm.client.widgets; ... header stuff... public class AutoSuggestItem extends ComboBoxItem { public AutoSuggestItem(String name, String title) { super(name, title); setType("comboBox"); setShowPickerIcon(false); setDisplayField(AutoSuggestValueDto.VALUE); setValueField(AutoSuggestValueDto.VALUE); setEmptyPickListMessage("No suggestions"); } }
Code:
private AutoSuggestItem postCode = new AutoSuggestItem("POST_CODE", DictionaryUtils.get(DictionaryConstants.POSTCODE)); ... postCode.setOptionDataSource(AddressAutoSuggestDS.getInstance(AddressAutoSuggestDS.ADDRESS_AUTO_SUGGEST_TYPE.POST_CODE));
In the showcase, the combobox example () works this way so I'm hopeful it can be achieved, the only difference I can see between mine and the showcase is that I use a datasource whereas the showcase hardcodes some values into a data map.
What can I do to make it behave this way?, there's no setShowPickerListWhenEmpty(boolean) method or anything similar that I can see.
Thanks,
Dale
Comment