请问 ,我使用showModelDialog进行传值, 我在JAVABEAN中把数据取出来后,怎么把值传回父窗体呢

解决方案 »

  1.   

    父窗口页面:
    function winOpen(param)
    {
        var k = window.showModalDialog(param) ;

    子窗口页面:
    function winClose(value) 

        window.returnValue=value; 
        window.close(); 
    } 当在子窗口页面中调用winClose(value)函数后,父窗口中的k值即为value。
    不知是否符合你的需求
      

  2.   

    接楼上的你的Bean根据参数,生成返回值,如果是单个的就直接<script>winClose("<%=myReturnValue%>");</script>就可以了。如果返回多个,可以
    <script>
    var arr = new Array();
    arr[0] = '<%=value1%>';
    arr[1] = '<%=value2%>';
    winClose(arr);
    </script>
      

  3.   

    谢2楼,我以前还真不知道winClose()还能返回一个数组
      

  4.   

    请问,那我要传递一个list 怎么办呢
      

  5.   

    不好意思,我知道了,但是有个小问题,就是window.close()这个命令不好使
      

  6.   

        <% 
           String name = "sssss";
       %>
      </head>
      <form name="form" onclick="winClose('<%=name%>')" action="/demo/inde.jsp">
     
       <input type="submit">
       <script type="text/javascript">
          function winClose(value)
          {
            window.returnValue = value;
            window.self.close();
            window.parent.close();
          }
       </script> 
       </form>这个是代码