问题描述
我试图将下拉框小部件转换为SuggestionBox,因为当前的下拉菜单有100多种选择。看起来你只能将字符串建议添加到SuggestOracle中。我需要能够添加一个自定义对象,该对象包含描述和与记录匹配的ID到数据库。我是否需要扩展SuggestOracle类?
是的,我知道你不能使用一对值,即Id和Value。您必须在建议框中添加您的字符串,也许您可以使用不同的解决方案,然后是建议框,即创建值列表弹出窗口。并添加尽可能多的字段,只要你喜欢。用分页显示您的数据在flex表中。使用选择处理程序更新您选择的行的表单。有关如何使用FlexTable和处理事件的信息,请参阅
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?
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
这篇关于用自定义对象建议创建一个GWT SuggestOracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!