用自定义对象建议创建一个GWT SuggestOracle [英] Creating a GWT SuggestOracle with custom object suggestions

查看:148
本文介绍了用自定义对象建议创建一个GWT SuggestOracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将下拉框小部件转换为SuggestionBox,因为当前的下拉菜单有100多种选择。看起来你只能将字符串建议添加到SuggestOracle中。我需要能够添加一个自定义对象,该对象包含描述和与记录匹配的ID到数据库。我是否需要扩展SuggestOracle类?

解决方案

是的,我知道你不能使用一对值,即Id和Value。您必须在建议框中添加您的字符串,也许您可​​以使用不同的解决方案,然后是建议框,即创建值列表弹出窗口。并添加尽可能多的字段,只要你喜欢。用分页显示您的数据在flex表中。使用选择处理程序更新您选择的行的表单。有关如何使用FlexTable和处理事件的信息,请参阅单行单击事件

SuggestOracle MultiWordSuggestOracle 的父类,它您已经在使用。

  public class MultiWordSuggestOracle extends SuggestOracle 

请参阅 MultiWordSuggestOracle


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

see MultiWordSuggestOracle

这篇关于用自定义对象建议创建一个GWT SuggestOracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆