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一米陽光 閱讀(5268) 評論(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)站導航:
           
          主站蜘蛛池模板: 开原市| 定日县| 鄂托克旗| 丽江市| 江华| 边坝县| 卓资县| 沂水县| 盐池县| 洛宁县| 大姚县| 图们市| 赤城县| 东平县| 郁南县| 华亭县| 清原| 博客| 金乡县| 田东县| 武穴市| 宝鸡市| 嘉禾县| 肇庆市| 尤溪县| 长汀县| 唐山市| 沾益县| 正阳县| 望都县| 揭东县| 丰镇市| 通城县| 新乐市| 贵溪市| 祥云县| 永和县| 讷河市| 孙吴县| 洞口县| 广安市|