waysun一路陽光

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

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理 ::
            167 隨筆 :: 1 文章 :: 64 評論 :: 0 Trackbacks
          list.jsp頁面點XXX字就用window.showModalDialog彈出一個頁面a.html里有個提交表單,提交以后,在后臺action處理,新頁面上有個返回,點返回還能出現index.jsp這個怎么實現呢?
          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里對應tree.jsp>
           <frame src="org!orgList.action" name="orgListFrame" id="orgListFrame" /><struts里對應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: 模態窗口提交到山頂到struts2的action后關閉自身并返回到父窗口,父窗口為一個iframe[未登錄] 2014-09-10 11:27 蘇打水
          fsfsfsfsfsfs  回復  更多評論
            

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


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


          網站導航:
           
          主站蜘蛛池模板: 渝中区| 江西省| 鄂尔多斯市| 闽清县| 土默特右旗| 渑池县| 富源县| 广西| 大英县| 盐边县| 凤山县| 西华县| 辽源市| 金门县| 阳城县| 定西市| 台南市| 浦北县| 扎兰屯市| 赤城县| 阳西县| 商丘市| 三原县| 临湘市| 肃南| 广水市| 陆川县| 安顺市| 庐江县| 涪陵区| 乌兰浩特市| 泸溪县| 汉中市| 嘉义市| 固安县| 塘沽区| 长海县| 天水市| 阆中市| 闽侯县| 台南县|