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


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


          網站導航:
           
          主站蜘蛛池模板: 上思县| 浏阳市| 永寿县| 榕江县| 奉化市| 大丰市| 霞浦县| 莱芜市| 新化县| 即墨市| 桦川县| 吉林省| 苏尼特左旗| 临武县| 兰西县| 陇南市| 定日县| 鹤岗市| 益阳市| 福安市| 曲沃县| 宜春市| 柞水县| 通州区| 赣州市| 华亭县| 运城市| 拜泉县| 连云港市| 高州市| 江北区| 岳阳县| 花莲市| 河北区| 兴和县| 景泰县| 古浪县| 黄冈市| 池州市| 肃南| 新龙县|