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 斷點
          頂頂頂頂  回復  更多評論
            


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


          網站導航:
           
          主站蜘蛛池模板: 双鸭山市| 刚察县| 呼伦贝尔市| 周至县| 夏邑县| 麟游县| 黔西| 北川| 金秀| 达尔| 衡阳县| 防城港市| 通山县| 顺昌县| 奈曼旗| 凌云县| 普宁市| 突泉县| 米易县| 通化市| 文昌市| 山西省| 叙永县| 甘孜| 安义县| 仲巴县| 浑源县| 鲁山县| 隆安县| 景泰县| 灵石县| 梁山县| 临清市| 重庆市| 达州市| 永州市| 颍上县| 黑河市| 迭部县| 英山县| 襄垣县|