風雨無阻

          項目中用到的JS代碼

          function addDev()
          {
           var sFeatures="dialogWidth:700px;dialogHeight:500px;scroll:no;";
           var customerId = document.all['cusId'].value;
           var result= window.showModalDialog('<%=appURL %>/businesspermit/DeviceSelectAction.do?formAction=toAddPage&customerId='+customerId,"",sFeatures);
           if(result!=null )
           {
            <logic:present name="edit" scope="request">
               document.CustomerSetForm.action="<%=appURL %>/businesspermit/CustomerSetAction.do?formAction=toEditBusi&showType=1";
            </logic:present>
             <logic:notPresent name="edit" scope="request">
             document.CustomerSetForm.action="<%=appURL %>/businesspermit/CustomerSetAction.do?formAction=getBusinessSet";
             </logic:notPresent>
            
            // window.location.reload();
            
            CustomerSetForm.submit();
           }
          }

          這個函數表示:添加新的設備JS函數,window.showModalDialog()會返回一個值result,如果result!=null,則刷新這個頁面。
          原來是用window.location.reload();刷新頁面的,但是這樣就不能保留之前頁面上輸入的數據,為了保留原來輸入的數據,換成了
          document.CustomerSetForm.action=“”;
          CustomerSetForm.submit();
          上面的語句表示:讓這個頁面重新指向另一個action地址,然后提交。這樣,用了Struts標簽后,以前四輸入的數據仍然會保留到返回后的頁面了。

          注意:在js代碼中,可能使用譬如說<logic:present>等標簽。

          posted on 2008-03-13 09:37 秋楓故事 閱讀(293) 評論(0)  編輯  收藏 所屬分類: 工作總結

          <2008年3月>
          2425262728291
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          新聞檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 筠连县| 敖汉旗| 吴旗县| 江北区| 三穗县| 龙川县| 彭阳县| 松江区| 宜良县| 探索| 镇宁| 湟中县| 八宿县| 临沧市| 永顺县| 苍梧县| 皋兰县| 札达县| 武宣县| 石城县| 大同县| 临漳县| 宜川县| 嘉荫县| 贵德县| 安达市| 攀枝花市| 盐边县| 手游| 嘉荫县| 涟源市| 平遥县| 兰考县| 纳雍县| 赫章县| 乐都县| 囊谦县| 革吉县| 扶风县| 淳化县| 炉霍县|