如何更改richfaces组合框的建议? [英] How to change the suggestion made by the richfaces combobox?

查看:57
本文介绍了如何更改richfaces组合框的建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用richfaces comboBox. 您可以在此处

I'm currently playing with the richfaces comboBox. You can check is here

我想知道是否有办法改变组合框中的建议,而不是建议以同一字母开头的Juste单词,而是建议以该字母或字母组合开头的其他单词的单词.

I would like to know if there a way change how the suggestion are made in the combo box, instead of suggesting juste word that start with the same letter it would suggest word that have other word starting with that letter or combination of letter.

以下是该示例中的一个示例: 从当前的组合框中,如果我键入"Mo",则该组合将显示Mongomery和"Monpelier",但是我希望它能够检测到"Des Moines",因为"Moines"以"Mo"开头.

Here a example from the demo: From the current combo box if I type "Mo" the combo show Mongomery and " Monpelier" but I would like it to detect "Des Moines" has well since "Moines" start with "Mo".

推荐答案

您可以使用

You can use <rich:suggestionBox> and define the custom autocomplete algorithm.

直接使用<rich:comboBox>是不可能的,但是如果扩展它并将其定义为自定义组件,则可以通过覆盖ComboBoxBaseRendererencodeSuggestionValues()方法(实际上是ComboBoxRenderer)来实现

It's not possible with <rich:comboBox> directly, but if you extend it and define it as a custom component, it is possible, by overriding the encodeSuggestionValues() method of ComboBoxBaseRenderer (actually of ComboBoxRenderer)

这篇关于如何更改richfaces组合框的建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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