码迷,mamicode.com
首页 > 其他好文 > 详细

项目积累——POPUP

时间:2015-04-18 17:27:47      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

父页面:

<td nowrap>

合同名称:

</td>

<td colspan="2" nowrap>

<param:popup clientCondition="true" condition="$bmbh,$nd"

type="cght1" empty="true" label="合同名称" readonly="true"

name="cghtzdwhListForm" property="mc" popupModal="dropdown"

popupDisplayModal="body" clickImg="/images/search.gif"

validator="text(0,350)" styleId="mc" targets="ht,mc,zje"

size="110" />

</td>子页面cghtzdList.jsp

<%

    String path = request.getContextPath();

    String basePath = request.getScheme() + "://"

           + request.getServerName() + ":" + request.getServerPort()

           + path + "/";

%>

<% 

    String parentElementId = request.getParameter("parentElementId");

    String syb = request.getParameter("bmbh");

    String qdrq = request.getParameter("nd");

    BaseCghtzdwhDAO bj = new BaseCghtzdwhDAO();

    List<CghtzdwhPO> l = bj.queryHt(syb, qdrq);

    int si=l.size();

    request.setAttribute("listHt", l);

   

   

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

 

    <head>

       <common:theme />

       <title>采购合同名称</title>

       <script language=‘JavaScript‘>

    function clickJs(ht,mc,zje)

    {

        var returnValue = new Object();

        returnValue.id=ht;

       if(ht==""|| ht == null){

           returnValue.name=‘‘;

       }else{

           returnValue.name="<"+ht+">"+mc+"("+zje+"元)";

       }

        returnValue.id=ht;

        window.returnValue=returnValue;

        window.parent.floatWindow<%=parentElementId%>.returnValue=returnValue;

       window.parent.floatWindow<%=parentElementId%>.hidden();

    }

function clear1(){

    var ms=document.getElementById("selectText").value;

     if(ms=="输入筛选条件"){

        document.getElementById("selectText").value="";

        document.getElementById("selectText").style.color="black";

     }

    }

     function set1(){

        if(document.getElementById("selectText").value==""){

        document.getElementById("selectText").value="输入筛选条件";

        document.getElementById("selectText").style.color="";

       }

     }

   

     function sel(){

    // alert(sss);

        var length1 = <%=si%>;

        var selectText = document.getElementById("selectText").value;

        var td1 = null;

        var tr1 = null;

    //  if(selectText!="" ){

        for (var i = 0 ;i<length1;i++){

           tr1 = document.getElementById(i);

            td1  =  tr1.childNodes[0];

           if((td1.innerText).indexOf(selectText)<0[c1] ){

              tr1.style.display="none";

           }else{

              tr1.style.display="";

           }

        }

       //}

     }

    </script>

 

</head>

<body bgColor="#F8FBFC">

<table>  

     <tr>

        <td bordercolor="red" background="green"><font color="black">输入<Strong>合同或合同号</Strong>进行模糊匹配<br/></font>

        <input type="text" onkeyup="sel()" id="selectText"  onblur="set1()"  value="输入筛选条件" onfocus="clear1()" size="24" style="" >

        </td>

     </tr>

</table>

 <table>

     <tr>

        <td onMouseOver=" this.style.cursor=‘hand‘;this.style.backgroundColor=‘#99E2FB‘  "

onclick="clickJs(‘‘,‘--请选择合同--‘,‘‘)" style="text-align: left; font-size: 12; color: blue" nowrap="nowrap" onmouseout="this.style.backgroundColor=‘‘">

--请选择合同--

</td>

</tr>

<tr id="0">

<%

     for (int i = 0; i < si; i++) {

%>

<td onMouseOver=" this.style.cursor=‘hand‘;this.style.backgroundColor=‘#99E2FB‘  "

               onclick="clickJs(‘<%=l.get(i).getHt().trim()%>‘,‘<%=l.get(i).getMc().trim()%>‘,‘<%=l.get(i).getZje()%>‘)" style="text-align: left; font-size: 12; color: blue" nowrap="nowrap" onmouseout="this.style.backgroundColor=‘‘">

               &lt;<%=l.get(i).getHt().trim()%>&gt;<%=l.get(i).getMc().trim()%>&nbsp;&nbsp;(金额:<%=l.get(i).getZje()%>元)

</td>

</tr>

<tr id="<%=i + 1%>">

<%

     }

%>

</tr>

</table>

</body>

 

Popup配置:

<!-- 采购合同付款计划维护 采购合同编号  -->

<entry key="cght2">

<bean class="com.cvicse.commons.param.config.PopupParameterConfig">

<property name="URL" value="/cvicdns/htgl/cght/cghtzdList.jsp?bmbh=?&amp;nd=?" />

<property name="style" value="top:0;" />

<property name="height" value="100" />

<property name="width" value="560" />

<property name="returnValueSeperatorOrProperties" value="id,name" />

</bean>

</entry>


 [c1]B.indexOf(c),C在字符串B中的索引

项目积累——POPUP

标签:

原文地址:http://www.cnblogs.com/Defry/p/4437518.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!