Context based search in JSP

旧城冷巷雨未停 提交于 2019-12-24 22:53:10

问题


I have a strange issue with the
<Select><option/></select> tag.I don't write any code to enable context search(ie. if I type A it will list all possible combinations with A like AA,Aa,Ab,AB,Ac,AC and so on(not in the same order)).Similarly if I type Ab it should list all combinations starting with Ab which it does but the problem is you have to be little quick here otherwise if I press A and wait some time and then press B then I wil get all contents starting with B and not with AB which is what was intented.Is there an alternate to this so that whatever I type will get the apt search results


回答1:


What you're describing is a behavior provided by the browser (and/or plugin(s) user may have installed), therefore if may differ for different clients.
In order to have a consistent customizable behavior you'll need to replace standard <select> with JS-based component. Look at ExtJS ComboBox implementation for example; there are many others available as well.



来源:https://stackoverflow.com/questions/1107944/context-based-search-in-jsp

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