waysun一路陽光

          不輕易服輸,不輕言放棄.--心是夢的舞臺,心有多大,舞臺有多大。踏踏實實做事,認認真真做人。

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
            167 隨筆 :: 1 文章 :: 64 評論 :: 0 Trackbacks
          list.jsp頁面點XXX字就用window.showModalDialog彈出一個頁面a.html里有個提交表單,提交以后,在后臺action處理,新頁面上有個返回,點返回還能出現(xiàn)index.jsp這個怎么實現(xiàn)呢?
          1.index.jsp<org!init.action>
            </head>
              <frameset cols="20%,*" frameborder="no" border="0" framespacing="0">
           <frame src="org!orgTree.action" name="orgTreeFrame" scrolling="no" noresize="noresize" id="orgTreeFrame" /><struts里對應(yīng)tree.jsp>
           <frame src="org!orgList.action" name="orgListFrame" id="orgListFrame" /><struts里對應(yīng)list.jsp>

            </frameset>
          2.

           public String orgTree()
           {
            return "orgTree";
           }
           public String orgList()
           {
            return "orgList";
           }

          3.list.jsp
                        var urls="org!toAdd.action?"+str;
                        var loc_x = (window.screen.width-300)/2;       //獲得窗口的垂直位置;
                           var loc_y = (window.screen.height-300)/2;           //獲得窗口的水平位置;
                           var width=450;
                           var height=300;
                        var re=window.showModalDialog(urls,parent,"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:"+width+"px;dialogHeight:"+height+"px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px",true);
           public String toAdd()
           {
            return "toAdd";
           }
          4.add.jsp
           function add()
           {
               var fom=document.forms.addForm;
              
               fom.action="org!add.action";
               fom.target="orgListFrame";
               fom.submit();
               window.close();
           }
          5.
              <package name="org" extends="struts-default" namespace="/">
            <action name="org!*" method="{1}"
             class="com.ssh.action.OrganizationAction">
             <result name="init">index.jsp</result>
             <result name="orgTree">.jsp</result>
             <result name="orgList">.jsp</result>
             <result name="toAdd">jsp/system/org/addorg.jsp</result>

            </action>
           </package>

           public String add()
           {
            try {
             response.sendRedirect("org!orgList.action");
             
            } catch (IOException e) {

             e.printStackTrace();
            }
            return null;
           }

          posted on 2010-01-08 14:48 weesun一米陽光 閱讀(5259) 評論(2)  編輯  收藏

          評論

          # re: 模態(tài)窗口提交到山頂?shù)絪truts2的action后關(guān)閉自身并返回到父窗口,父窗口為一個iframe[未登錄] 2014-09-10 11:27 蘇打水
          fsfsfsfsfsfs  回復  更多評論
            

          # re: 模態(tài)窗口提交到struts2的action后關(guān)閉自身并返回到父窗口,父窗口為一個iframe[未登錄] 2014-11-27 15:06 斷點
          頂頂頂頂  回復  更多評論
            


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 佛学| 霍林郭勒市| 武宁县| 连平县| 太原市| 博兴县| 襄城县| 宁南县| 雷波县| 汨罗市| 肇庆市| 蕲春县| 广饶县| 南陵县| 澜沧| 永福县| 泰州市| 共和县| 万载县| 西畴县| 肥西县| 绿春县| 滦平县| 金乡县| 东乡| 惠安县| 海淀区| 化德县| 天门市| 遵义县| 米泉市| 霞浦县| 漳浦县| 瑞昌市| 鲁山县| 怀远县| 承德县| 富川| 凯里市| 恩施市| 海伦市|