- 浏览: 28173 次
- 性别:
- 来自: 哈尔滨
文章分类
最新评论
public JSONArray findPrettyRuleByName(String prettyRuleName, String wllx, ServletContext ctx) throws Exception { RootDaoInterface dao = DataSourceHelper.getDaoInterfae(ctx); String sql = "select id,zdxf,zxsc,ychf,name from tb_entity_lianghaoleixing where name like '%" + prettyRuleName + "%' and wllx = ?"; JSONArray jSONArray = new JSONArray(); List list = dao.preparedQuery(sql, new Object[]{wllx}); for (Iterator it = list.iterator(); it.hasNext();) { Hashtable ht = new Hashtable(); ht = (Hashtable) it.next(); JSONObject jSONObject =new JSONObject(); jSONObject.put("id", ht.get("id").toString()); jSONObject.put("zdxf",ht.get("zdxf").toString()); jSONObject.put("zxsc", ht.get("zxsc").toString()); jSONObject.put("name", ht.get("name").toString()); jSONObject.put("ychf", ht.get("ychf").toString()); jSONArray.put(jSONObject); } return jSONArray; }
public ActionForward selectPrettyRule(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { try { String prettyRuleName = request.getParameter("pName"); String wllx = request.getParameter("wllx"); prettyRuleName = new String(prettyRuleName.getBytes("ISO-8859-1"), "UTF-8"); PrintWriter out = response.getWriter(); JSONArray jsonArray = null; try { jsonArray = prettyRuleManageService.findPrettyRuleByName( prettyRuleName, wllx, this.getServlet() .getServletContext()); } catch (Exception e) { e.printStackTrace(); } // JSONArray array = JSONArray.fromObject(list); out.print(jsonArray.toString()); out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } return null; }
<%@ page contentType="text/html;charset=UTF-8"%> <%@ taglib uri="/WEB-INF/tlds/frame-database.tld" prefix="database"%> <%@ taglib uri="/WEB-INF/tlds/frame-beans.tld" prefix="beans"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <% // 语句准备 String path = request.getContextPath(); String wllx = request.getParameter("wllx"); String sql = "select id,zdxf,zxsc,ychf,name from tb_entity_lianghaoleixing where wllx = '" + wllx + "'"; %> <head> <title>查询靓号类型</title> <script type="text/javascript" src="<%=path%>/js/jquery-1.4.2.js" charset="UTF-8"></script> <link rel="stylesheet" href="<%=path%>/css/main.css" type="text/css"> <script type="text/javascript" language="javascript"> $(document).ready(function() { var tishi = $("#tishi"); var search = $("#search"); var tbdy = $("#tbdy"); $("#search").click(function (){ var proName=$("#proName").val(); search.attr("disabled","disabled"); if(proName == null || proName == ""){ tishi.html(""); $("#tbdy").empty(); search.removeAttr("disabled"); alert("请输入查询条件"); return; } tishi.css("color","red").css("font-size","13").html("正在查询请稍后!"); $.getJSON("<%=path %>/prettyRule.do?action=selectPrettyRule", {pName:proName,wllx:'<%=wllx %>'}, function (data){ if(data.length == 0 ){ tishi.css("color","red").css("font-size","13").html("查询结束!"); tishi.html(""); $("#tbdy").empty(); search.removeAttr("disabled"); alert("没有找到相关记录,请重新输入查询条件"); return; } tishi.html(""); tishi.css("color","red").css("font-size","13").html("查询结束!"); search.removeAttr("disabled"); tbdy.empty(); tbdy.append("<tr><td width='100px;' height='25' align='center' bgcolor='#E7F0F7' class='textAnmedia'>序号</td><td width='400px;' align='center' bgcolor='#E7F0F7' class='textAnmedia'>靓号类型名称</td></tr>"); for(var i=0;i<data.length;i++){ var aa = data[i].id + "|" + data[i].name + "|"+ data[i].zdxf + "|"+ data[i].zxsc + "|"+ data[i].ychf; $("#tbdy").append('<tr><td td align="center" bgcolor="#ffffff" class="tdIndex" >' + data[i].id +'</td><td align="left" bgcolor="#ffffff" class="tdValue" style="cursor: pointer;" onclick="returnAllVaule(\'' + aa + '\')">' + data[i].name +'</td></tr>'); } $(".tdValue").mouseover(function(){ var trNode = $(this); trNode.css("background","#FFFFFF").css("cursor","pointer").css("font-weight","bold").css("color","red"); }); $(".tdValue").mouseout(function(){ var trNode = $(this); trNode.css("background","#F0F5F7").css("font-weight","normal").css("color","#7F9DB9"); }); }); }); $(".tdValue").mouseover(function(){ var trNode = $(this); trNode.css("background","#FFFFFF").css("cursor","pointer").css("font-weight","bold").css("color","red"); }); $(".tdValue").mouseout(function(){ var trNode = $(this); trNode.css("background","#F0F5F7").css("font-weight","normal").css("color","#7F9DB9"); }); }); function returnAllVaule(AllVaule) { window.returnValue = AllVaule; window.close(); } </script> <style type="text/css"> #input_select{ position:absolute; left:130px; top:100px; } #tableList{ position:absolute; top:170px; } </style> </head> <body> <table width="600px" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="73A2D6"> <tr> <td colspan="4" align="center" height="25" background="<%=path%>/images/bg_gen_head.jpg" >靓号类型查询</td> </tr> <tr bgcolor="#FFFFFF"> <td width="15%" height="25px;" align="right" bgcolor="#E7F0F7">靓号名称:</td> <td width="85%" align="left"> <input type ="text" id="proName" style=width:150px;/> <input type="button" value=" 查询 " id="search"/><span id="tishi"></span> </td> </tr> </table> <br/> <div id="listContent" align="center"> <table width="500px" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="73A2D6"> <tbody id="tbdy"> <tr> <td colspan="9" align="center" height="25" background="<%=path%>/images/bg_gen_head.jpg" >查询结果如下</td> </tr> <tr bgcolor="#8EC0E6"> <td width="100px;" height="25" align="center" bgcolor="#E7F0F7" class="textAnmedia"> 编号 </td> <td width="400px;"align="center" bgcolor="#E7F0F7" class="textAnmedia"> 靓号类型名称 </td> </tr> <beans:tagHandle id="tagID"> <database:prepareQuery id="<%=tagID%>" scope="page"> <%=sql%> </database:prepareQuery> <database:rows id="db" query='<%=tagID%>' autoGrid="false"> <tr> <td align="center" bgcolor="#ffffff" style="cursor: pointer;" class="tdIndex" ><%=db.get("id") %></td> <td align="left" bgcolor="#ffffff" style="cursor: pointer;" class="tdValue" onclick="returnAllVaule('<%=db.get("id") + "|" + db.get("name") + "|" + db.get("zdxf") + "|" + db.get("zxsc") + "|" + db.get("ychf") %>')"><%=db.get("name") %></td> </tr> </database:rows> <database:release query='<%=tagID%>' /> </beans:tagHandle> </tbody> </table> </div> </div> </div> </body> </html>
$("#proid").click(function (){ if($('#wllx').val() == '-1'){ alert('请选择网络类型'); return false; } var value = window.showModalDialog($('#path').val() + '/jsp/haoka/prettyRuleManage/prettyTypeQuery.jsp?wllx=' + $("#wllx").val(),'',''); $("#prettyTypeId").val(value.split('|')[0]); $("#prettyType").val(value.split('|')[1]); $("#zdxf").val(value.split('|')[2]); $("#zxsc").val(value.split('|')[3]); $("#ychf").val(value.split('|')[4]); });
<input type="text" id="prettyType" name="prettyType" readonly="readonly" style="width: 345px;"/> <input type="button" value="点击查找靓号类型" id="proid"/>
发表评论
-
jmpopups点击空白处 ,弹出层就会消失的问题
2011-11-03 16:37 809$("#popupLayerScreenLocker ... -
jmpopups与chickbox(带有附件可下载直接查看效果)
2011-08-05 15:47 1425index.html <!DOCTYPE html ... -
jquery有关
2011-04-01 15:39 667$("#selectID option[value= ... -
自动补全功能
2010-12-06 10:39 1415/** * Servlet */ package c ... -
Jquery + Css 实现横纵菜单下拉效果
2010-11-18 16:54 1759ul,li { /*清除ul,li默认的小原点*/ l ... -
省市县的二级联动
2010-11-18 16:50 1412<tr> <td height=& ...
相关推荐
这是一款非常实用的基于bootstrap的jQuery多功能模态对话框插件。该bootstrap jQuery模态对话框集警告框、确认框和对话框于一体。是一款不可多得的多功能、多用途的模态对话框插件。
jQuery手机移动端模态对话框插件是一款支持三种类型的弹出对话框,支持自定义按钮,文字等,并支持事件监听。
VC中模态对话框和非模态对话框的编程
点击运行弹出一个对话框,点击DIALOG1按钮弹出一个模态对话框,在该对话框的编辑框输入文本点击确定该对话框消失且输入的文本被显示到主对话框MainDialog中,点击DAILOG2按钮弹出一个非模态对话框,操作现象和模态...
非模态对话框相对于模态对话框,他的创建和销毁过程和模态对话框有一定的区别,非模态对话框需要重载函数OnCanel,并且在这个函数中调用DestroyWindow。并且不能调用基类的OnCancel,因为基类的OnCancel调用了...
MFC中有两种类型的对话框:模态对话框和非模态对话框。 模态对话框是指当其显示时,程序会暂停执行,直到关闭这个模态对话框后,才能继续执行程序中其他任务。非模态对话框是指当其显示时,允许转而执行程序中其他...
非模态的对话框是独立的,就是说和主程序可以同时交换数据,而模态的对话框则只能和自己交换。换句话说,模态对话框很霸道,你开了它就无法在同一个应用程序中的其他地方干活了,比如那个经常用的openfile dialog。...
模态对话框与非模态对话框程序示例 Java源程序
非模态对话框与模态对话框不同,在非模态对话框活动的同时,用户还可以在应用程序的其他地方工作,而模态对话框在其关闭之前,用户不能在同一个应用程序的其他地方工作。本例将从主框架窗口创建一个简单的非模态...
MFC创建模态对话框和非模态对话框实例小程序,学习如何在程序开发中使用模态对话框和非模态对话框
MFC中经常会用到弹出模态或非模态对话框,模态对话框与非模态对话框容易混淆
因系统需求,要在关闭子模态对话框后刷新父模态对话框,做的一个小测试。
jquery的模态对话框,不多说了,自己看看吧,内附多版本的Demo
万能模态对话框 万能模态对话框 万能模态对话框 万能模态对话框 uDialog unity 模态对话框,通用
VS2010/MFC模态对话框和非模态对话框的创建和使用
基于vs2005,在ObjectARX中使用MFC:模态,非模态对话框
非模态对话框与模态对话框不同,在非模态对话框活动的同时,用户还可以在应用程序的其他地方工作,而模态对话框在其关闭之前,用户不能在同一个应用程序的其他地方工作。本代码将从主框架窗口创建一个简单的非模态...
不同与Popup,这是自定义样式的模态对话框,是模态的!整个对话框作为一个独立的组件使用.........
VisualC 实效编程 9 非模态对话框VisualC 实效编程 9 非模态对话框VisualC 实效编程 9 非模态对话框VisualC 实效编程 9 非模态对话框VisualC 实效编程 9 非模态对话框VisualC 实效编程 9 非模态对话框VisualC 实效...
这是一款轻量级jQuery动画模态窗口对话框特效,可以轻松的制作出带动画效果的模态窗口跟AJAX的模态对话框,含多种样式。