- 浏览: 238548 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
bihailantian_:
[/size]我而且额 ...
得到集合中的最后一条记录&和求基数偶数 -
w327569056w:
能发一份吗??谢谢 303430060@qq.com
在线购物系统毕业论文 &图书管理系统毕业论文 -
yuan23:
在线购物的系统,谢谢,464302726@qq.com ...
在线购物系统毕业论文 &图书管理系统毕业论文 -
君心可晴:
作业相关
想参考参考
1035236640@qq.com
LZ ...
在线购物系统毕业论文 &图书管理系统毕业论文 -
smith789:
该交论文了,题目相近,感谢博主!smith5623@126.c ...
在线购物系统毕业论文 &图书管理系统毕业论文
首先说一下我做的功能需求。所要实现的内容。
我要做一个根据域来配置险种的三级关联包括其它信息的显示。其实主要的是第二级的下拉选项查询,所有的显示信息都是从第二级的下拉选项ID来配置的,比如它的上一级也是根据二级所在的类型中查找上一级,三级联查相对来说比较简单些,只要找到了二级险种的ID就能联查出三级的信息。
由于实现需要的东西太多,现重要代码具体实例如下:
1.必备的一个dwr.jar文件不可缺少的,导入此包后可以在WEB-INF下的dwr.xml文件里配置相应的bean 没有这个文件你就什么都不能做。为什么用到这个dwr文件呢,如果只是做个简单的关联查询是用不到的,鉴于一级和三级类型都要根据二级的配置来联查。所以要传入二级的ID给一级和三级下拉就必须用到对象保存数据。用到对象保存数据,就要用到dwr.jar文件了。
2.二级联查显示一个固定的Action必不可缺。现代码如下:
package com.eline.epicc.insurance.struts;
import com.eline.epicc.insurance.model.*;
import com.eline.epicc.insurance.*;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class ServletTestAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
int targetId = Integer.parseInt(request.getParameter("TypeId"));
ArrayList list = new ArrayList();
list=Insurances.GetInsuranceType1s2(targetId);
String xml_start = "<selects>";
String xml_end = "</selects>";
String xml = "";
String eStr;
if(targetId==0){
xml = "<select><value>0</value><text>请选择险种</text></select>";
}else{
for(int i=0;i<list.size();i++){
InsuranceTypeObj obj =(InsuranceTypeObj)list.get(i);
eStr=new String(obj.getIn_Genre().getBytes("UTF-8"),"ISO-8859-1");
xml+= "<select><value>"+obj.getIn_ID()+"</value><text>"+eStr+"</text></select>";
}
String last_xml = xml_start + xml + xml_end;
response.getWriter().write(last_xml);
}
return null;
}
}
3.对数据库的查询操作读取数据
1)根据传入的用户ID所在的域来查找对应配置的信息
public ArrayList getDutyPersonMobileID(int userId)throws SQLException{
ArrayList list = new ArrayList();
Connection conn = null;
CallableStatement stmt = null;
ResultSet rst = null;
try{
String strSQL="{ call dbo.Insurances_GetUserInRegionID(?)}";
conn = super.getDBConnection();
stmt = conn.prepareCall(strSQL);
//stmt = conn.prepareStatement(strSQL);
stmt.setInt(1, userId);
rst = stmt.executeQuery();
while(rst.next()){
InsuranceTypeObj obj = new InsuranceTypeObj();
obj.setRegionID(rst.getInt("indexID"));
obj.setIn_ID(rst.getInt("in_ID"));
obj.setIn_GenreID(rst.getInt("in_GenreId"));
obj.setIn_Explain(rst.getString("in_Explain"));
list.add(obj);
}
}catch(Exception ex){
ex.printStackTrace();
}finally{
super.closeResultSet(rst);
super.closeStatement(stmt);
super.closeConnection(conn);
}
return list;
}
2)剩下的数据查询其实重要的域对应配置的一个关系是在数据库中实现的。不要要告诉的是得到二级险种的ID后就可以根据这个ID找它的上级和下级,这个应该并不难找吧。
代码省略。
4.最后具体使用的页面:
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<%@ page import="org.blue.util.*" %>
<%@ page import="com.eline.epicc.utils.*" %>
<%@ taglib uri="/tlds/eline-common.tld" prefix="common"%>
<%@ taglib uri="/tlds/eline-user.tld" prefix="user"%>
<%@ page import="com.eline.epicc.insurance.*"%>
<%@ page import="com.eline.epicc.insurance.model.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.eline.epicc.user.*"%>
<%@ page import="com.eline.epicc.user.model.*"%>
/*页面要导入的dwr配置信息*/
<script type='text/javascript' src='/e-picc-ox/dwr/interface/Insurances.js'></script>
<script type='text/javascript' src='/e-picc-ox/dwr/engine.js'></script>
<script type='text/javascript' src='/e-picc-ox/dwr/util.js'></script>
<%
ArrayList list = new ArrayList();
String dpMobile = StringUtils.toString(request.getParameter("dpMobile"));
User user =Users.getUser(0,dpMobile,false,false);
if (user == null || user.getUserId() == 0) {
System.out.println("Can not get instance of current user.");
}
int tmpId=user.getUserId();
list=Insurances.GetInsuranceType1s(tmpId);
String pId = request.getParameter("PId");
String cId = request.getParameter("CId");
String ph = request.getParameter("ph");
String lengthDate=request.getParameter("lengthDate");
String startDate = request.getParameter("startDate");
String endDate = request.getParameter("endDate");
String tel = request.getParameter("tel"); //投保人联系方式
if(tel==null){
tel = "无";
}
String type = request.getParameter("type");
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<SCRIPT type="text/javascript">
var req;
window.onload=function(){
}
function Change_Select()
{
var zhi=document.getElementById('hero').value;
var url="${pageContext.request.contextPath}/insurance/servletTest.do?TypeId="+escape(zhi);
if(window.XMLHttpRequest)
{
req=new XMLHttpRequest();
}else if(window.ActiveXObject)
{
req=new ActiveXObject("Microsoft.XMLHTTP");
}
if(req)
{
req.open("GET",url,true);
req.onreadystatechange=callback;
req.send(null);
}
}
function callback()
{
if(req.readyState == 4)
{
if(req.status == 200)
{
parseMessage();
}else{
alert("Not able to retrieve description"+req.statusText);
}
}
}
function parseMessage()
{
var xmlDoc=req.responseXML.documentElement;
var xSel=xmlDoc.getElementsByTagName('select');
var select_root=document.getElementById('skill');
select_root.options.length=0;
for(var i=0;i<xSel.length;i++)
{
var xValue=xSel[i].childNodes[0].firstChild.nodeValue;
var xText=xSel[i].childNodes[1].firstChild.nodeValue;
var option=new Option(xText,xValue);
try{
select_root.add(option);
}catch(e){
}
}
}
</SCRIPT>
<script type="text/javascript">
function insurance_prev() {
window.location.href="${pageContext.request.contextPath}/input/in_InsuranceNo_1.jsp";
}
function submitForm(){
document.form1.in_ID.value=document.form1.skill.value;
document.all["backParam"].value="pId="+document.all["PId"].value
+",cId="+document.all["CId"].value
+",ph="+document.all["ph"].value
+",dpMobile="+document.all["dpMobile"].value
+",startDate="+document.all["startDate"].value
+",endDate="+document.all["endDate"].value
+",lengthDate="+document.all["lengthDate"].value
+",tel="+document.all["tel"].value
+",type="+document.all["type"].value
+",skill="+document.all["skill"].value;
document.form1.submit();
}
function ocTest(){
var a = document.form1.skill.value;
document.form1.in_ID.value=document.form1.skill.value;
}
function closea(){
window.close();
}
function closego(){
window.close();
}
/*方法实现得到页面属性的值*/
function findByGenreId(skillId){
var id=skillId.value;
Insurances.getInsuranceTypeOthers(id, callbackInsurances);
}
function callbackInsurances(obj){
var in_costScopeMin = document.getElementById("in_costScopeMin");
var in_costScopeMax = document.getElementById("in_costScopeMax");
var in_fronsScopeMin = document.getElementById("in_fronsScopeMin");
var in_fronsScopeMax = document.getElementById("in_fronsScopeMax");
var in_burdenScope = document.getElementById("in_burdenScope");
var in_InsuranceFei = document.getElementById("in_InsuranceFei");
var in_InsuranceLv = document.getElementById("in_InsuranceLv");
in_costScopeMin.innerText = obj.in_costScopeMin; ///意义等同,都可以得到
in_costScopeMax.firstChild.nodeValue = obj.in_costScopeMax;///意义等同,都可以得到 in_costScopeMin.innerText 是在span标签上显示 obj.in_costScopeMax:配置的dwr文件里取出对象里保存的信息
in_fronsScopeMin.innerText = obj.in_fronsScopeMin;
in_fronsScopeMax.innerText = obj.in_fronsScopeMax;
in_burdenScope.innerText = obj.in_burdenScope;
in_InsuranceFei.value = obj.in_InsuranceFei;
in_InsuranceLv.value = obj.in_InsuranceLv;
if(in_InsuranceFei.value == 0 || in_InsuranceFei.value ==0.0){
in_InsuranceFei.value = "";
}
if(in_InsuranceLv.value == 0 || in_InsuranceLv.value ==0.0){
in_InsuranceLv.value = "";
}
}
</script>
<img height="3" src="${pageContext.request.requestURL}/images/blank.gif" /><br />
<table cellspacing="3" cellpadding="0" width="98%" border="0" style="border-bottom:1px solid #2f4e7c">
<tr>
<td style="FONT-FAMILY: SimSun"><b>当前位置:</b>录入 - 新建保单 - 险种选择录入
</td>
</tr>
</table>
<img height="5" src="${pageContext.request.contextPath}/images/blank.gif" /><br />
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD bgColor="#325380" height="7"><IMG src="${pageContext.request.contextPath}/skin/content-top-left_delt.gif"></TD>
<TD width="7" bgColor="#325380" height="7"><IMG src="${pageContext.request.contextPath}/skin/blank.gif"></TD>
</TR>
<TR>
<TD style="BORDER-LEFT: #325380 1px solid; BORDER-BOTTOM: #325380 1px solid; PADDING: 2px;">
<%if(tmpId!=0){%>
<form name="form1" action="<%=SiteUrls.getInstance().getProperty("input.insuranceEBdo")%>" method="post">
<table cellspacing="0" width="100%" border="0" height="450">
<tr>
<th height=30 colspan="5" style="BORDER-BOTTOM: #dbdce3 1px solid; BACKGROUND-COLOR: #e9f5f7;COLOR: #444444;" align="center">
请选择填写险种信息<input type="hidden" name="userID" id="userID" value="<%=tmpId %>"/>
</th>
</tr>
<tr>
<td colSpan="2" valign="middle" align="center">
<table class="clsDataList" cellspacing="0" width="600" border="0" style="BORDER:#dbdce3 1px solid;">
<tr>
<td>
险种分类:
</td>
<td>
<SELECT name="hero" id="hero" onChange="Change_Select()">
<OPTION value="0">请选择险种分类</OPTION>
<%
for(int i=0;i<list.size();i++){
InsuranceTypeObj obj =(InsuranceTypeObj)list.get(i);
%>
<OPTION value="<%=obj.getIn_ID()%>"><%=obj.getIn_Genre()%></OPTION>
<%}%>
</SELECT>
</td>
<td>
险 种:
</td>
<td>
<SELECT name="skill" id="skill" onchange="findByGenreId(this);">
<OPTION value="0">请选择险种</OPTION>
</SELECT>
<input type="hidden" name="in_ID" id="in_ID" value="">
</td>
</tr>
<tr>
<td>
险种说明:
</td>
<td colspan="3" width="500">
保费范围:最小值 <span id="in_costScopeMin"> </span> 、 最大值 <span id="in_costScopeMax"> </span><br>
保额费率:最小值 <span id="in_fronsScopeMin"> </span> 、 最大值 <span id="in_fronsScopeMax"> </span><br>
责任范围:<br> <span id="in_burdenScope"> </span>
</td>
</tr>
<tr>
<td>
保 费:
</td>
<td colspan="3">
<input type="text" name ="in_InsuranceFei" value="" maxlength="10">
</td>
</tr>
<tr>
<td>
保额费率:
</td>
<td colspan="3">
<input type="text" name ="in_InsuranceLv" value="" maxlength="10">
</td>
</tr>
<tr>
<td>
<input type="hidden" name="PId" value="<%=pId %>">
<input type="hidden" name="CId" value="<%=cId %>">
<input type="hidden" name="ph" value="<%=ph %>">
<input type="hidden" name="dpMobile" value="<%=dpMobile%>">
<input type="hidden" name="lengthDate" value="<%=lengthDate %>">
<input type="hidden" name="startDate" value="<%=startDate %>">
<input type="hidden" name="endDate" value="<%=endDate %>">
<input type="hidden" name="tel" value="<%=tel%>">
<input type="hidden" name="type" value="<%=type%>">
</td>
</table>
</td>
</tr>
</table>
<table style="BORDER-RIGHT: #c0c0c0 1px solid; BORDER-TOP: #c0c0c0 1px solid; BORDER-LEFT: #c0c0c0 1px solid; BORDER-BOTTOM: #c0c0c0 1px solid"
cellspacing="1" cellpadding="1" width="100%" bgColor="#f0f0f0" border="0">
<tr>
<td><input type="hidden" name="backUrl" value="in_Insurance_3.jsp" />
<input type="hidden" name="backParam" value="" />
<input type="hidden" name="status" value="3" />
<input type="hidden" name="action" value="add" />
</td>
<td align="center">
<input type="button" class="clsBtn4w" id="sb1" name="sb1" value="提 交" onclick="submitForm();"/>
<input type="button" class="clsBtn4w" id="sb2" name="sb2" value="返 回" onclick="javascript:insurance_prev();"/>
</td></tr>
</table>
</form>
<%}else{%>
<table border="0" width="100%" height="90">
<tr><td width="100%"><font color="red">错误提示:<br> 您录入的承保人手机不是合法号码,没有承保权限.请您核对后在次录入!</font><td></tr>
<tr><td width="100%" align="center"><input type="button" class="clsBtn4w" name="btnn" value="确定" onclick="javaScript:closego();"/><td></tr>
</table>
<%} %>
</TD>
<TD vAlign="bottom" width="7" bgColor="#325380"><IMG src="${pageContext.request.contextPath}/skin/content-right-bottom_delt.gif"></TD>
</TR>
</TABLE>
------------------
最后一定不要忘记在web.xml里添加对dwr的配置
配置如下:
<!-- lily add dwr config -->
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>
org.directwebremoting.servlet.DwrServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
配置完成后也不要忘记导入dwr.jar包
如果也在苦寻多级联查的IT新手们,此代码希望能够帮上你的忙。
以上代码如果有不懂之处,请留言我在详解!
我要做一个根据域来配置险种的三级关联包括其它信息的显示。其实主要的是第二级的下拉选项查询,所有的显示信息都是从第二级的下拉选项ID来配置的,比如它的上一级也是根据二级所在的类型中查找上一级,三级联查相对来说比较简单些,只要找到了二级险种的ID就能联查出三级的信息。
由于实现需要的东西太多,现重要代码具体实例如下:
1.必备的一个dwr.jar文件不可缺少的,导入此包后可以在WEB-INF下的dwr.xml文件里配置相应的bean 没有这个文件你就什么都不能做。为什么用到这个dwr文件呢,如果只是做个简单的关联查询是用不到的,鉴于一级和三级类型都要根据二级的配置来联查。所以要传入二级的ID给一级和三级下拉就必须用到对象保存数据。用到对象保存数据,就要用到dwr.jar文件了。
2.二级联查显示一个固定的Action必不可缺。现代码如下:
package com.eline.epicc.insurance.struts;
import com.eline.epicc.insurance.model.*;
import com.eline.epicc.insurance.*;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class ServletTestAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
int targetId = Integer.parseInt(request.getParameter("TypeId"));
ArrayList list = new ArrayList();
list=Insurances.GetInsuranceType1s2(targetId);
String xml_start = "<selects>";
String xml_end = "</selects>";
String xml = "";
String eStr;
if(targetId==0){
xml = "<select><value>0</value><text>请选择险种</text></select>";
}else{
for(int i=0;i<list.size();i++){
InsuranceTypeObj obj =(InsuranceTypeObj)list.get(i);
eStr=new String(obj.getIn_Genre().getBytes("UTF-8"),"ISO-8859-1");
xml+= "<select><value>"+obj.getIn_ID()+"</value><text>"+eStr+"</text></select>";
}
String last_xml = xml_start + xml + xml_end;
response.getWriter().write(last_xml);
}
return null;
}
}
3.对数据库的查询操作读取数据
1)根据传入的用户ID所在的域来查找对应配置的信息
public ArrayList getDutyPersonMobileID(int userId)throws SQLException{
ArrayList list = new ArrayList();
Connection conn = null;
CallableStatement stmt = null;
ResultSet rst = null;
try{
String strSQL="{ call dbo.Insurances_GetUserInRegionID(?)}";
conn = super.getDBConnection();
stmt = conn.prepareCall(strSQL);
//stmt = conn.prepareStatement(strSQL);
stmt.setInt(1, userId);
rst = stmt.executeQuery();
while(rst.next()){
InsuranceTypeObj obj = new InsuranceTypeObj();
obj.setRegionID(rst.getInt("indexID"));
obj.setIn_ID(rst.getInt("in_ID"));
obj.setIn_GenreID(rst.getInt("in_GenreId"));
obj.setIn_Explain(rst.getString("in_Explain"));
list.add(obj);
}
}catch(Exception ex){
ex.printStackTrace();
}finally{
super.closeResultSet(rst);
super.closeStatement(stmt);
super.closeConnection(conn);
}
return list;
}
2)剩下的数据查询其实重要的域对应配置的一个关系是在数据库中实现的。不要要告诉的是得到二级险种的ID后就可以根据这个ID找它的上级和下级,这个应该并不难找吧。
代码省略。
4.最后具体使用的页面:
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<%@ page import="org.blue.util.*" %>
<%@ page import="com.eline.epicc.utils.*" %>
<%@ taglib uri="/tlds/eline-common.tld" prefix="common"%>
<%@ taglib uri="/tlds/eline-user.tld" prefix="user"%>
<%@ page import="com.eline.epicc.insurance.*"%>
<%@ page import="com.eline.epicc.insurance.model.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.eline.epicc.user.*"%>
<%@ page import="com.eline.epicc.user.model.*"%>
/*页面要导入的dwr配置信息*/
<script type='text/javascript' src='/e-picc-ox/dwr/interface/Insurances.js'></script>
<script type='text/javascript' src='/e-picc-ox/dwr/engine.js'></script>
<script type='text/javascript' src='/e-picc-ox/dwr/util.js'></script>
<%
ArrayList list = new ArrayList();
String dpMobile = StringUtils.toString(request.getParameter("dpMobile"));
User user =Users.getUser(0,dpMobile,false,false);
if (user == null || user.getUserId() == 0) {
System.out.println("Can not get instance of current user.");
}
int tmpId=user.getUserId();
list=Insurances.GetInsuranceType1s(tmpId);
String pId = request.getParameter("PId");
String cId = request.getParameter("CId");
String ph = request.getParameter("ph");
String lengthDate=request.getParameter("lengthDate");
String startDate = request.getParameter("startDate");
String endDate = request.getParameter("endDate");
String tel = request.getParameter("tel"); //投保人联系方式
if(tel==null){
tel = "无";
}
String type = request.getParameter("type");
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<SCRIPT type="text/javascript">
var req;
window.onload=function(){
}
function Change_Select()
{
var zhi=document.getElementById('hero').value;
var url="${pageContext.request.contextPath}/insurance/servletTest.do?TypeId="+escape(zhi);
if(window.XMLHttpRequest)
{
req=new XMLHttpRequest();
}else if(window.ActiveXObject)
{
req=new ActiveXObject("Microsoft.XMLHTTP");
}
if(req)
{
req.open("GET",url,true);
req.onreadystatechange=callback;
req.send(null);
}
}
function callback()
{
if(req.readyState == 4)
{
if(req.status == 200)
{
parseMessage();
}else{
alert("Not able to retrieve description"+req.statusText);
}
}
}
function parseMessage()
{
var xmlDoc=req.responseXML.documentElement;
var xSel=xmlDoc.getElementsByTagName('select');
var select_root=document.getElementById('skill');
select_root.options.length=0;
for(var i=0;i<xSel.length;i++)
{
var xValue=xSel[i].childNodes[0].firstChild.nodeValue;
var xText=xSel[i].childNodes[1].firstChild.nodeValue;
var option=new Option(xText,xValue);
try{
select_root.add(option);
}catch(e){
}
}
}
</SCRIPT>
<script type="text/javascript">
function insurance_prev() {
window.location.href="${pageContext.request.contextPath}/input/in_InsuranceNo_1.jsp";
}
function submitForm(){
document.form1.in_ID.value=document.form1.skill.value;
document.all["backParam"].value="pId="+document.all["PId"].value
+",cId="+document.all["CId"].value
+",ph="+document.all["ph"].value
+",dpMobile="+document.all["dpMobile"].value
+",startDate="+document.all["startDate"].value
+",endDate="+document.all["endDate"].value
+",lengthDate="+document.all["lengthDate"].value
+",tel="+document.all["tel"].value
+",type="+document.all["type"].value
+",skill="+document.all["skill"].value;
document.form1.submit();
}
function ocTest(){
var a = document.form1.skill.value;
document.form1.in_ID.value=document.form1.skill.value;
}
function closea(){
window.close();
}
function closego(){
window.close();
}
/*方法实现得到页面属性的值*/
function findByGenreId(skillId){
var id=skillId.value;
Insurances.getInsuranceTypeOthers(id, callbackInsurances);
}
function callbackInsurances(obj){
var in_costScopeMin = document.getElementById("in_costScopeMin");
var in_costScopeMax = document.getElementById("in_costScopeMax");
var in_fronsScopeMin = document.getElementById("in_fronsScopeMin");
var in_fronsScopeMax = document.getElementById("in_fronsScopeMax");
var in_burdenScope = document.getElementById("in_burdenScope");
var in_InsuranceFei = document.getElementById("in_InsuranceFei");
var in_InsuranceLv = document.getElementById("in_InsuranceLv");
in_costScopeMin.innerText = obj.in_costScopeMin; ///意义等同,都可以得到
in_costScopeMax.firstChild.nodeValue = obj.in_costScopeMax;///意义等同,都可以得到 in_costScopeMin.innerText 是在span标签上显示 obj.in_costScopeMax:配置的dwr文件里取出对象里保存的信息
in_fronsScopeMin.innerText = obj.in_fronsScopeMin;
in_fronsScopeMax.innerText = obj.in_fronsScopeMax;
in_burdenScope.innerText = obj.in_burdenScope;
in_InsuranceFei.value = obj.in_InsuranceFei;
in_InsuranceLv.value = obj.in_InsuranceLv;
if(in_InsuranceFei.value == 0 || in_InsuranceFei.value ==0.0){
in_InsuranceFei.value = "";
}
if(in_InsuranceLv.value == 0 || in_InsuranceLv.value ==0.0){
in_InsuranceLv.value = "";
}
}
</script>
<img height="3" src="${pageContext.request.requestURL}/images/blank.gif" /><br />
<table cellspacing="3" cellpadding="0" width="98%" border="0" style="border-bottom:1px solid #2f4e7c">
<tr>
<td style="FONT-FAMILY: SimSun"><b>当前位置:</b>录入 - 新建保单 - 险种选择录入
</td>
</tr>
</table>
<img height="5" src="${pageContext.request.contextPath}/images/blank.gif" /><br />
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD bgColor="#325380" height="7"><IMG src="${pageContext.request.contextPath}/skin/content-top-left_delt.gif"></TD>
<TD width="7" bgColor="#325380" height="7"><IMG src="${pageContext.request.contextPath}/skin/blank.gif"></TD>
</TR>
<TR>
<TD style="BORDER-LEFT: #325380 1px solid; BORDER-BOTTOM: #325380 1px solid; PADDING: 2px;">
<%if(tmpId!=0){%>
<form name="form1" action="<%=SiteUrls.getInstance().getProperty("input.insuranceEBdo")%>" method="post">
<table cellspacing="0" width="100%" border="0" height="450">
<tr>
<th height=30 colspan="5" style="BORDER-BOTTOM: #dbdce3 1px solid; BACKGROUND-COLOR: #e9f5f7;COLOR: #444444;" align="center">
请选择填写险种信息<input type="hidden" name="userID" id="userID" value="<%=tmpId %>"/>
</th>
</tr>
<tr>
<td colSpan="2" valign="middle" align="center">
<table class="clsDataList" cellspacing="0" width="600" border="0" style="BORDER:#dbdce3 1px solid;">
<tr>
<td>
险种分类:
</td>
<td>
<SELECT name="hero" id="hero" onChange="Change_Select()">
<OPTION value="0">请选择险种分类</OPTION>
<%
for(int i=0;i<list.size();i++){
InsuranceTypeObj obj =(InsuranceTypeObj)list.get(i);
%>
<OPTION value="<%=obj.getIn_ID()%>"><%=obj.getIn_Genre()%></OPTION>
<%}%>
</SELECT>
</td>
<td>
险 种:
</td>
<td>
<SELECT name="skill" id="skill" onchange="findByGenreId(this);">
<OPTION value="0">请选择险种</OPTION>
</SELECT>
<input type="hidden" name="in_ID" id="in_ID" value="">
</td>
</tr>
<tr>
<td>
险种说明:
</td>
<td colspan="3" width="500">
保费范围:最小值 <span id="in_costScopeMin"> </span> 、 最大值 <span id="in_costScopeMax"> </span><br>
保额费率:最小值 <span id="in_fronsScopeMin"> </span> 、 最大值 <span id="in_fronsScopeMax"> </span><br>
责任范围:<br> <span id="in_burdenScope"> </span>
</td>
</tr>
<tr>
<td>
保 费:
</td>
<td colspan="3">
<input type="text" name ="in_InsuranceFei" value="" maxlength="10">
</td>
</tr>
<tr>
<td>
保额费率:
</td>
<td colspan="3">
<input type="text" name ="in_InsuranceLv" value="" maxlength="10">
</td>
</tr>
<tr>
<td>
<input type="hidden" name="PId" value="<%=pId %>">
<input type="hidden" name="CId" value="<%=cId %>">
<input type="hidden" name="ph" value="<%=ph %>">
<input type="hidden" name="dpMobile" value="<%=dpMobile%>">
<input type="hidden" name="lengthDate" value="<%=lengthDate %>">
<input type="hidden" name="startDate" value="<%=startDate %>">
<input type="hidden" name="endDate" value="<%=endDate %>">
<input type="hidden" name="tel" value="<%=tel%>">
<input type="hidden" name="type" value="<%=type%>">
</td>
</table>
</td>
</tr>
</table>
<table style="BORDER-RIGHT: #c0c0c0 1px solid; BORDER-TOP: #c0c0c0 1px solid; BORDER-LEFT: #c0c0c0 1px solid; BORDER-BOTTOM: #c0c0c0 1px solid"
cellspacing="1" cellpadding="1" width="100%" bgColor="#f0f0f0" border="0">
<tr>
<td><input type="hidden" name="backUrl" value="in_Insurance_3.jsp" />
<input type="hidden" name="backParam" value="" />
<input type="hidden" name="status" value="3" />
<input type="hidden" name="action" value="add" />
</td>
<td align="center">
<input type="button" class="clsBtn4w" id="sb1" name="sb1" value="提 交" onclick="submitForm();"/>
<input type="button" class="clsBtn4w" id="sb2" name="sb2" value="返 回" onclick="javascript:insurance_prev();"/>
</td></tr>
</table>
</form>
<%}else{%>
<table border="0" width="100%" height="90">
<tr><td width="100%"><font color="red">错误提示:<br> 您录入的承保人手机不是合法号码,没有承保权限.请您核对后在次录入!</font><td></tr>
<tr><td width="100%" align="center"><input type="button" class="clsBtn4w" name="btnn" value="确定" onclick="javaScript:closego();"/><td></tr>
</table>
<%} %>
</TD>
<TD vAlign="bottom" width="7" bgColor="#325380"><IMG src="${pageContext.request.contextPath}/skin/content-right-bottom_delt.gif"></TD>
</TR>
</TABLE>
------------------
最后一定不要忘记在web.xml里添加对dwr的配置
配置如下:
<!-- lily add dwr config -->
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>
org.directwebremoting.servlet.DwrServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
配置完成后也不要忘记导入dwr.jar包
如果也在苦寻多级联查的IT新手们,此代码希望能够帮上你的忙。
以上代码如果有不懂之处,请留言我在详解!
评论
5 楼
pangbuddy
2008-11-17
我用RICHFACE的AJAX功能和DROPDOWN 菜单 结合后台动态生成DROPDOWN 的LIST,效果也不错。
4 楼
yuanyeekong
2008-11-13
function aaa(){ }[color=olive][/color][align=center][/align]
3 楼
elice
2008-07-24
个人认为不用刷页面是更好的解决办法
另外请楼主把代码用<code></code>圈起来
另外请楼主把代码用<code></code>圈起来
2 楼
yourenyouyu2008
2008-07-23
你没用到jsf吗,如果用了多级联动实现是很简单的,并且通用。不需要自己写一句ajax。因为是如此的简单,所以jsf里面是没有提供多级联动的组件的。
1 楼
xieboxin
2008-07-22
就个人而言,我喜欢写ajax来实下多级联动菜单,不依赖任何的框架。这样写的有自己新晰的思路,便于自己的控制。
有时间我把我写的多级联动代码贴出来。
有时间我把我写的多级联动代码贴出来。
发表评论
-
struts2和struts1的区别
2010-02-03 16:36 995Struts1: action对象只有一个,不管谁去 ... -
Struts2.0学习笔记(一)命名空间和.xml文件配置
2010-02-03 16:31 1707首先要说声对不起,感谢关注我博客的朋友。近期因为换工 ... -
动态 Table 添加删除行
2009-07-23 13:55 2809<html> <head> ... -
js 电子邮件验证
2009-07-17 10:24 2327<html> <title>aaa&l ... -
ZK 常用
2009-06-12 16:36 6558在一个页面中使用多种脚本语言 <zscript lang ... -
zk框架 特殊字符的替换方式
2009-04-27 15:15 1200特殊字符替换: < 用 < ... -
ZK框架 鼠标移动事件 & 移动在文本上显示信息
2009-04-23 14:06 3288例如一个超链接:在点击之前鼠标移动到连接上显示相应信息; 方法 ... -
js 最实用的一些操作
2009-04-01 13:58 11791. oncontextmenu="window.e ... -
Ajax状态值大全
2009-03-12 15:33 17380**:未被始化 1**:请求收到,继续处理 2**:操作 ... -
js 事件大全
2009-03-09 09:43 912一般事件 事件 浏览器支持 描述 onClick IE3|N ... -
汉洛塔算法
2008-12-03 16:21 1344private void MoveItem(int n, ... -
经典八皇后算法
2008-12-02 12:06 1630using System; using System.Data ... -
js 数字验证
2008-11-07 17:32 1105以下代码可直接复制使用: <SCRIPT LANGUAG ... -
实例 数组 广义表
2008-10-14 11:42 10871、 void RSh(int A[n],int k)//把数 ... -
数据结构四、串
2008-10-06 10:48 1956实例: void String_Reverse(Stringt ... -
数据结构三、栈与队列
2008-09-26 11:39 933基础实例:3.1 typedef stru ... -
数据结构二、线性表
2008-09-25 13:33 1156基础实例:2.1 Status DeleteK(SqList ... -
Web打印预览后 弹出窗口无法关闭
2008-09-23 11:17 4627jatoolsPrinter:打印控件出现了一个问题。这 ... -
数据结构一、基础实例
2008-09-22 17:58 899基础的数据结构实例: 1.1 void print_desc ... -
免费Web打印控件
2008-09-22 17:50 7354我现在的项目中有打印的模块,用的是一个免费的打印控件。 ...
相关推荐
代码最下面 各项的参数截图 代码如下 户籍所在地 prop=censusLand xss=removed> <el-cascader v-model=ruleForm.censusLand style=width:180px;padding-left:7px;width:270px ... va
实验内容【必做】 (1)建立一个包含三个frame的窗口 (2)第一个frame1中包含一个select,内容是中国的各个省 (3)第二个frame2中同样含有一个select,内容是各省的地级市 (4)第三个frame3用来显示关于某地...
微信小程序picker ...滚动选择器,现支持三种选择器,通过mode来区分,分别是普通选择器,时间选择器,日期选择器,默认是普通选择器 普通选择器:mode=selector 属性名 类型 默认值 说明 range
微信小程序在自带的表单组件中加入了选择器picker,并给出了常用的时间和省市区三级联动选择器,但日常开发中不可能仅仅使用这些选择器,所以我们在学习时先写一个常见的自定义选择器,用于满足项目中的日常需要。...
省市区三级联动的三种实现的方式(原生js实现)方式一:第一个使用select的onchange事件及selectedIndex属性来完成,其中省市区(县)数据是在网上找的,不能保证真实性;第二个是第一个的修改版,使用的数据来源于...
4.二级联动 42 5.其它表单标签 44 6.其它常用标签的使用(代码参名为“补充”的文件夹下的tag.jsp) 45 七、国际化 47 1.action级别下的国际化 47 2.配置package的资源文件 48 3.app级别的资源文件 48 4.使用资源...
10-20 5 smarty二级联动 10-20 6 smarty完成静态化 10-20 7 10-20 8 smarty分页技术 10-20 9 10-22 1 ajax介绍 无刷新验证用户名 10-22 2 ajax如何处理xml格式返回数据 10-22 3 json 10-22 4 ajax如何处理json格式...
10-20 5 smarty二级联动 10-20 6 smarty完成静态化 10-20 7 10-20 8 smarty分页技术 10-20 9 10-22 1 ajax介绍 无刷新验证用户名 10-22 2 ajax如何处理xml格式返回数据 10-22 3 json 10-22 4 ajax如何处理json格式...
10-20 5 smarty二级联动 10-20 6 smarty完成静态化 10-20 7 10-20 8 smarty分页技术 10-20 9 10-22 1 ajax介绍 无刷新验证用户名 10-22 2 ajax如何处理xml格式返回数据 10-22 3 json 10-22 4 ajax如何处理json格式...
10-20 5 smarty二级联动 10-20 6 smarty完成静态化 10-20 7 10-20 8 smarty分页技术 10-20 9 10-22 1 ajax介绍 无刷新验证用户名 10-22 2 ajax如何处理xml格式返回数据 10-22 3 json 10-22 4 ajax如何处理json格式...
10-20 5 smarty二级联动 10-20 6 smarty完成静态化 10-20 7 10-20 8 smarty分页技术 10-20 9 10-22 1 ajax介绍 无刷新验证用户名 10-22 2 ajax如何处理xml格式返回数据 10-22 3 json 10-22 4 ajax如何处理json格式...
深入剖析ASP.NET组件设计]一书第三章关于ASP.NET运行原理讲述的补白 asp.net 运行机制初探(httpModule加载) 利用反射来查看对象中的私有变量 关于反射中创建类型实例的两种方法 ASP.Net应用程序的多进程模型 NET委托...
第2章:【Power BI 数据分析快速上手】Power BI之Power Pivot插件详解 15.Power Pivot之数据导入 16.Power Pivot之层次结构创建 17.Power Pivot之创建KPI 18.Power Pivot之DAX函数(一) 19.Power Pivot之DAX函数...
05 js练习之二级联动 06 jquery以及jquery对象介绍 07 jquery选择器 08 jquery的查找筛选器 09 jquery练习之左侧菜单 第44章 01 jquery属性操作之html,text,val方法 02 jquery循环方法和attr,prop方法 03 jquery...