風雨無阻

          項目中用到的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)

          隨筆分類

          隨筆檔案

          新聞檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 象山县| 永年县| 北流市| 隆子县| 凤冈县| 买车| 宝丰县| 随州市| 黄龙县| 五寨县| 临汾市| 彝良县| 泸水县| 罗城| 萨迦县| 石渠县| 德格县| 白玉县| 兴文县| 成武县| 南陵县| 新源县| 聂荣县| 资源县| 徐州市| 望谟县| 闵行区| 沐川县| 东乡县| 潼关县| 商都县| 信宜市| 河东区| 逊克县| 黄冈市| 巫溪县| 巴林左旗| 西乌珠穆沁旗| 托克托县| 闵行区| 集安市|