有个下拉框,当在下拉框输入搜索字符h时,
下拉列表显示相应的item “hello” “head”
输入w item显示 “whree” “why”
输入 why 只显示 “why”
下拉列表显示相应的item “hello” “head”
输入w item显示 “whree” “why”
输入 why 只显示 “why”
解决方案 »
- struts标签 int 效验问题,求大神帮忙解答!
- jsp 与 java script 是一个概念么??
- hibernate惹的祸
- Tomcat + Apache 负载均衡Session不能保持的问题
- ECLIPSE3.2+MYECLIPSE5的问题!
- jbuilder9 run j2ee 时出错?
- 迷茫中~~没了动力~~请各位多多指教
- 怎样处理非正常退出,如ctrl+c 点击退出按钮等,像tomcat那样。
- EJB新手上路--运行j2ee -verbose 的错误(80分送上)
- struts错误 HTTP Status 404 - /HelloWorldStruts2/hello.action
- jsp报表导出excel文件
- struts2文件上传问题
为什么不在数据库查询非要拿到LIST再进行判断呢?
<commands>
<command id="1" cmd="update_traffic">
<name>traffic1</name>
<count control_type="text">21</count>
<type control_type="combo" readonly="false">
<option id="1">aa</option>
<option id="2">bb</option>
</type>
<enable control_type="checkbox" />
<help>hello update!</help>
</command>
<command id="2" cmd="start_traffic">
<name control_type="text">traffic2</name>
<help>hello start!</help>
</command>
<command id="3" cmd="delete_traffic">
<name control_type="text">traffic3</name>
<help>hello command!</help>
</command>
<command id="4" cmd="stop_traffic">
<name control_type="text">traffic4</name>
<help>hello stop!</help>
</command>
</commands>我是从XML中读取数据的 取出cmd放到list
public static List<Attribute> getSortList(List<Attribute> list) {
for (int i = 0; i < list.size(); i++) {
for (int j = i + 1; j < list.size(); j++) {
if (list.get(i).getValue().compareToIgnoreCase(
list.get(j).getValue()) > 0) { // 忽略大小写
String t = list.get(i).getValue();
list.get(i).setValue(list.get(j).getValue());
list.get(j).setValue(t);
}
}
}
我把List先排序了,SWT的Combo有查找的功能,不过在Combo输入什么只显示相应item 这个没实现。