JSP中基于上下文的搜索 [英] Context based search in JSP

查看:160
本文介绍了JSP中基于上下文的搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对
< Select>< option />< / select>
标签存在一个奇怪的问题。我不写任何代码来启用上下文搜索(例如,如果我键入A,它将列出与A,AA,A,AB,AB,AC,AC等所有可能的组合(不以相同的顺序)) 。类似地,如果我输入Ab,它应该列出所有以Ab开头的组合,但问题是你必须在这里快一点,否则,如果我按A并等待一段时间,然后按B,那么我将获得以B开头的所有内容而不是AB,这是什么意思。是否有这样的替代,以便我输入的任何内容都将得到apt搜索结果

解决方案

p>您所描述的是由浏览器(和/或用户可能已安装的插件)提供的行为,因此如果对于不同的客户端可能会有所不同。

为了获得一致的可自定义您需要将行为替换为标准< select>与基于JS的组件。查看 ExtJS ComboBox实施例如;还有很多其他可用的。


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

解决方案

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.

这篇关于JSP中基于上下文的搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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