Atitit.ui control --- drop -down menu Select the implementation of the control select HTML
1. Call & model implementation 1
2.-----select.jsp------1
1. Call& Modelthe implementation
Proj.vod2
<%
List li=new ArrayList ();
Map m=new HashMap ();
M.put ("Lab", " Love ");
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 "/>
Author:: Old Wow's paw attilax Ayron, email:[email protected]
Reprint please indicate source: 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 drop-down list data binding issues. _ Baidu knows . htm
Atitit.ui Control---Drop-down menu select the implementation of the control select HTML