Atitit.ui控件---下拉菜单选择控件的实现select html
Atitit.ui控件---下拉菜单选择控件的实现select html
1. 调用& model的实现
Proj.vod2
<%
List li=new ArrayList();
Map m=new HashMap ();
m.put("lab","爱情");
m.put("v","1");
li.add(m);
DropDownList DropDownList1=new DropDownList();
DropDownList1.DataSource = li;
DropDownList1.DataValueField = "v";
DropDownList1.DataTextField = "lab";
DropDownList1.DataBind();
session.setAttribute("ddl1",DropDownList1);
%>
<jsp:include page="../com.attilax/ui/select.jsp?DropDownListId=ddl1&id=applicationType" flush="true" />
作者:: 老哇的爪子 Attilax 艾龙, EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax
2. -----select.jsp------
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" %>
<%@page import="java.io.File"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%@page import="System.Web.UI.WebControls.DropDownList"%>
<%@page import="com.attilax.core"%>
<select name="<%=request.getParameter("id")%>" id="<%=request.getParameter("id")%>">
<%
DropDownList ddl= (DropDownList) session.getAttribute(request.getParameter("DropDownListId") );
List li=ddl.DataSource;
%>
<%= core.toJsonStrO88(ddl)%>
<%
for (Object object : li) {
Map m=(Map) object;
%>
<option value="<%=m.get(ddl.DataValueField)%>"><%=m.get(ddl.DataTextField)%></option>
<% } %>
</select>
ASP.NET中下拉列表数据绑定的问题。_百度知道.htm