📄 sortedlist.jsp
字号:
<%@ taglib uri="/tags/web-sortedlist" prefix="sort"%>
<%@ taglib uri="/tags/web-html" prefix="html"%>
<%@ taglib uri="/tags/web-i18n" prefix="web"%>
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="org.loushang.web.taglib.util.skin.SkinUtils"%>
<%@ page import="java.util.*"%>
<%@ page import="html.*"%>
<%@ page import="org.loushang.web.taglib.util.Global"%>
<%
Vector options = new Vector();
options.add(new LabelValueBean("Label 0", "Value 0"));
options.add(new LabelValueBean("Label 1", "Value 1"));
options.add(new LabelValueBean("Label 2", "Value 2"));
options.add(new LabelValueBean("Label 3", "Value 3"));
options.add(new LabelValueBean("Label 4", "Value 4"));
options.add(new LabelValueBean("Label 5", "Value 5"));
options.add(new LabelValueBean("Label 6", "Value 6"));
options.add(new LabelValueBean("Label 7", "Value 7"));
options.add(new LabelValueBean("Label 8", "Value 8"));
options.add(new LabelValueBean("Label 9", "Value 9"));
request.setAttribute("options", options);
Map map = new HashMap();
map.put("id", "2");
map.put("ids", new String[] { "2", "4" });
map.put("name", "web-html组件");
map.put("code", "Value 3");
map.put("codes", new String[] { "Value 2", "Value 4", "Value 6" });
map.put("optionsCollection", options);
request.setAttribute(Global.getString("html.data"), map);
%>
<html>
<head>
<title>list</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<web:js src="sortedlist.js"/>
</head>
<table width="100%">
<tr>
<td><label class="title">sortedlist 组件</label></td>
<%
String file = request.getServletPath().substring(1);
String app = request.getContextPath();
%>
<td><label class="title">url:<%=file%></label></td>
<td align="right" valign="bottom" nowrap> [<a
href="<%=app%>/src.jsp?target=<%=file %>" target="source">源代码</a>] </td>
</tr>
</table>
<hr>
<body scroll="auto">
<table>
<tr>
<td><sort:sortedList size="10" id="sortedList" name="sortedList"
property="id" style="width:100" multiple="true">
<html:option value="1">新浪</html:option>
<html:option value="2">搜狐</html:option>
<html:option value="3">中国人</html:option>
<html:option value="4">343</html:option>
<html:option value="5">google</html:option>
<html:option value="6">csdn</html:option>
</sort:sortedList></td>
<td width="100"></td>
<td>
<table align="center">
<tr>
<td>选项值:</td>
<td><input type=text id="value"></td>
</tr>
<tr>
<td>选项标题:</td>
<td><input type=text id="title"></td>
</tr>
<tr>
<td>
<button name="addOption"
onclick="sortedList.addOptions(document.all('value').value,document.all('title').value);">增加选项</button>
<button name="delOptions" onclick="sortedList.delOptions();">删除选项</button>
</td>
<td>
<button name="delOptions" onclick="alert(sortedList.getSelValues());">选项值</button>
<button name="delOptions" onclick="alert(sortedList.getSelTitles());">选项标题</button>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -