Creating a GWT SuggestOracle with custom object suggestions

只谈情不闲聊 提交于 2019-12-30 14:46:06

问题


I'm trying to convert a drop down box widget into a SuggestionBox because the current drop down menu has 100+ choices. It seems like you can only add String suggestions to a SuggestOracle though. I need to be able to add a custom object that contains both a description and an ID that matches the record to the database though. Would I have to extend the SuggestOracle class?


回答1:


Yes as i know you can not use pair of values i.e Id and Value. You have to add your strings in suggestion box perhaps you can use different solution other then suggestion box i.e. Create a List of values popup. And add as many fields as you like. display your data in flex table with pagination. update your form with the selected row by using selecition handler. for reference how to use FlexTable and handle events please see able Single Row Click Event

SuggestOracle is the parent class of MultiWordSuggestOracle which you are already yousing.

public class MultiWordSuggestOracle   extends SuggestOracle

see MultiWordSuggestOracle



来源:https://stackoverflow.com/questions/10249430/creating-a-gwt-suggestoracle-with-custom-object-suggestions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!