一本大道久久a久久精二百,精品国产第一国产综合精品,翔田千里在线视频http://www.aygfsteel.com/moster/Truth is truth to the end of reckoning <hr/> <br/> <br/>真理就是真理,琢磨到最后依然是真理——《惡有惡報》zh-cnWed, 18 Jun 2025 14:45:08 GMTWed, 18 Jun 2025 14:45:08 GMT60Struts2的ActionContexthttp://www.aygfsteel.com/moster/archive/2011/07/27/355118.htmlMon$ter!Mon$ter!Wed, 27 Jul 2011 05:00:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/27/355118.htmlhttp://www.aygfsteel.com/moster/comments/355118.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/27/355118.html#Feedback0http://www.aygfsteel.com/moster/comments/commentRss/355118.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/355118.html閱讀全文

Mon$ter! 2011-07-27 13:00 發(fā)表評論
]]>
Struts2的ActionContexthttp://www.aygfsteel.com/moster/archive/2011/07/27/355119.htmlMon$ter!Mon$ter!Wed, 27 Jul 2011 05:00:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/27/355119.htmlhttp://www.aygfsteel.com/moster/comments/355119.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/27/355119.html#Feedback0http://www.aygfsteel.com/moster/comments/commentRss/355119.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/355119.html閱讀全文

Mon$ter! 2011-07-27 13:00 發(fā)表評論
]]>
修改Flexigrid源碼http://www.aygfsteel.com/moster/archive/2011/07/26/355079.htmlMon$ter!Mon$ter!Tue, 26 Jul 2011 12:18:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/26/355079.htmlhttp://www.aygfsteel.com/moster/comments/355079.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/26/355079.html#Feedback2http://www.aygfsteel.com/moster/comments/commentRss/355079.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/355079.htmlhttp://www.eps2008.cn/index.php?aid=50 修改flexigrid源碼一(json,checkbox)

 

1.修改默認(rèn)的json格式為key:value

修改前

rows: [{id:'ZW',cell:['ZW','ZIMBABWE','Zimbabwe','ZWE','716']},{id:'ZW',cell:['ZW','ZIMBABWE','Zimbabwe','ZWE','716']}]

修改后

rows: [{id:'1',name:'Anson',sex:'男',email:'chents@gpcsoft',qq:'75526201'},{id:'2',name:'Anson',sex:'男',email:'chents@gpcsoft',qq:'75526201'}]

源碼修改說明

找到 if (p.dataType=='json')

將其后的大括號{}內(nèi)容改為:

$.each
(
data.rows,
function(i,row)
{
var tr = document.createElement('tr');
if (i % 2 && p.striped) tr.className = 'erow';

if (row.id) tr.id = 'row' + row.id;

//by anson QQ:75526201 chents@gpcsoft.com 轉(zhuǎn)載請保留
var tdVal = [];

//給每行添加id
if (p.rowId){

$.each( data.rows[i], function(x,y){

if(p.rowId==x){tr.setAttribute('id',y);
}

})
}

if (p.colModel){

for (j=0;j<p.colModel.length;j++){

var cm = p.colModel[j];
//取列名
var seleceName = cm.name;
//json Bug修復(fù)://打包文件中未加入,請自行加入 
if(typeof(data.rows[i][seleceName])=='undefined'){data.rows[i][seleceName]=''}

//過濾key
$.each( data.rows[i], function(x,y){

if(seleceName==x){tdVal.push(y)}

})

}
}

//add cell
$('thead tr:first th',g.hDiv).each
(
function ()
{

var td = document.createElement('td');
var idx = $(this).attr('axis').substr(3);
td.align = this.align;
td.innerHTML = tdVal[idx];
//td.innerHTML = row.cell[idx];
$(tr).append(td);
td = null;
}
);


if ($('thead',this.gDiv).length<1) //handle if grid has no headers
{

for (idx=0;idx<cell.length;idx++)
{
var td = document.createElement('td');
//td.innerHTML = row.cell[idx];
td.innerHTML = tdVal[idx];
$(tr).append(td);
td = null;
}
}

$(tbody).append(tr);
tr = null;
}
);
 

2.加入checkbox

只要設(shè)置checkbox:true即可在前面顯示多選框

源碼修改說明

a.找到 $('div:eq('+n+')',g.cDrag).css({'left':cdpos+'px'}).show();

替換為:

//添加多選框
if (p.checkbox) {
$('div:eq('+n+')',g.cDrag).css({'left':cdpos+22+'px'}).show();
}
else{
$('div:eq('+n+')',g.cDrag).css({'left':cdpos+'px'}).show();
}

b.找到//add cell

前面插入:

//添加多選框
if (p.checkbox) {

var cth = $('<th/>');

var cthch = $('<input type="checkbox" value="' + $(tr).attr('id') +'"/>');

var objTr = $(tr);

cthch.addClass("noborder").click(function(){

if(this.checked){

objTr.addClass('trSelected');
}
else{
objTr.removeClass('trSelected');
}
})

cth.addClass("cth").attr({ width: "22"}).append(cthch);

$(tr).prepend(cth);


}

c.找到$(this).toggleClass('trSelected');

后面插入:

//添加多選框
if(p.checkbox){
if($(this).hasClass('trSelected')){
$(this).find('input')[0].checked=true;
}
else{
$(this).find('input')[0].checked=false
}
}

d.找到if ($('th',g.hDiv).length)

在其后的{}大括號中加入

//添加多選框
if (p.checkbox) {
$('tr',g.hDiv).each(
function(){

var cth = $('<td/>');

var cthch = $('<input type="checkbox"/>');

cthch.click(function(){
if(this.checked){
$('tbody tr',g.bDiv).each(function(){
$(this).addClass('trSelected').find('input')[0].checked=true;
})
}
else{

$('tbody tr',g.bDiv).each(function(){
$(this).removeClass('trSelected').find('input')[0].checked=false;
})
}
})

cth.addClass("cth").attr({ width: "22" }).append(cthch);

$(this).prepend(cth);

})
};

e.找到p = $.extend({

添加默認(rèn)設(shè)置

checkbox:false,//是否要多選框
rowId:'id',//綁定行的id

 

修改后結(jié)果

點擊查看原圖

未加入多條件搜索,右鍵,打印,導(dǎo)出Excel等功能,如有需要聯(lián)系作者Anson,QQ:75526201

點擊查看原圖

修改后文件下載:點擊下載附件

 

 


http://hi.baidu.com/wzjstrong/blog/item/fc64e036da94221d90ef393b.html
http://blog.csdn.net/liuzhoulong/article/details/6076071
jQuery插件flexigrid是像ext的DataGrid一樣的活動表格插件,使用它首先要引入query.js,還要引入flexigrid.js和flexigrid.css
        看看插件中部分代碼以及說明 

Titleif (t.grid)   
  1.             return false; // return if already exist   
  2.   
  3.         // apply default properties   
  4.         p = $.extend({   
  5.             height : 200, // flexigrid插件的高度,單位為px   
  6.             width : 'auto', // 寬度值,auto表示根據(jù)每列的寬度自動計算   
  7.             striped : true, // 是否顯示斑紋效果,默認(rèn)是奇偶交互的形式   
  8.             novstripe : false,   
  9.             minwidth : 30, // 列的最小寬度   
  10.             minheight : 80, // 列的最小高度   
  11.             resizable : true, // 是否可伸縮   
  12.             url : false, // ajax方式對應(yīng)的url地址   
  13.             method : 'POST', // 數(shù)據(jù)發(fā)送方式   
  14.             dataType : 'xml', // 數(shù)據(jù)加載的類型   
  15.             checkbox : false,// 是否要多選框   
  16.             errormsg : '連接錯誤!',// 錯誤提示信息   
  17.             usepager : false, // 是否分頁   
  18.             nowrap : true, // 是否不換行   
  19.             page : 1, // 默認(rèn)當(dāng)前頁   
  20.             total : 1, // 總頁面數(shù)   
  21.             useRp : true, // 是否可以動態(tài)設(shè)置每頁顯示的結(jié)果數(shù)   
  22.             rp : 15, // 每頁默認(rèn)的結(jié)果數(shù)   
  23.             rpOptions : [5,101520253040],// 可選擇設(shè)定的每頁結(jié)果數(shù)   
  24.             title : false,// 是否包含標(biāo)題   
  25.             pagestat : '顯示第 {from} 條到 {to} 條,共 {total} 條數(shù)據(jù)',// 顯示當(dāng)前頁和總頁面的樣式   
  26.             procmsg : '正在處理,請稍候 ...',// 正在處理的提示信息   
  27.             query : '',// 搜索查詢的條件   
  28.             qtype : '',// 搜索查詢的類別   
  29.             nomsg : '沒有數(shù)據(jù)存在!',// 無結(jié)果的提示信息   
  30.             minColToggle : 1, // 允許顯示的最小列數(shù)   
  31.             showToggleBtn : true, // 是否允許顯示隱藏列,該屬性有bug設(shè)置成false點擊頭腳本報錯   
  32.             hideOnSubmit : true,// 隱藏提交   
  33.             autoload : true,// 自動加載   
  34.             blockOpacity : 0.5,// 透明度設(shè)置   
  35.             onToggleCol : false,// 當(dāng)在行之間轉(zhuǎn)換時,可在此方法中重寫默認(rèn)實現(xiàn),基本無用   
  36.             onChangeSort : false,// 當(dāng)改變排序時,可在此方法中重寫默認(rèn)實現(xiàn),自行實現(xiàn)客戶端排序   
  37.             onSuccess : false,// 成功后執(zhí)行   
  38.             onSubmit : false   
  39.               // 調(diào)用自定義的計算函數(shù)   
  40.           }, p);  
了解了每個屬性的含義后就可以根據(jù)自己的需要來配置了,

Title
$("#flex1").flexigrid({
	url: 'post2.php',
	dataType: 'json',
	colModel : [
		{display: 'ISO', name : 'iso', width : 40, sortable : true, align: 'center'},
		{display: 'Name', name : 'name', width : 180, sortable : true, align: 'left'},
		{display: 'Printable Name', name : 'printable_name', width : 120, sortable : true, align: 'left'},
		{display: 'ISO3', name : 'iso3', width : 130, sortable : true, align: 'left', hide: true},
		{display: 'Number Code', name : 'numcode', width : 80, sortable : true, align: 'right'}
		],
	buttons : [
		{name: 'Add', bclass: 'add', onpress : test},
		{name: 'Delete', bclass: 'delete', onpress : test},
		{separator: true}
		],
	searchitems : [
		{display: 'ISO', name : 'iso'},
		{display: 'Name', name : 'name', isdefault: true}
		],
	sortname: "iso",
	sortorder: "asc",
	usepager: true,
	title: 'Countries',
	useRp: true,
	rp: 15,
	showTableToggleBtn: true,
	width: 700,
	height: 200
});   
Title$("#flex1").flexigrid
   (
   {
        url:  './contract_getAllJsonData.action?startDate=<ss:date name="startDate" format="yyyy-MM-  dd"/>&endDate=<ss:date name="endDate" format="yyyy-MM-dd"/>&contractId=${contractId}',
   dataType: 'json',
   method: 'POST',
   colModel : [
    {display: '廣告位', name : 'advName', width : 300, sortable : true, align: 'center'},
    {display: '開始投放時間', name : 'start', width : 180, sortable : true, align: 'left'},
    {display: '結(jié)束投放時間', name : 'end', width : 180, sortable : true, align: 'left'},
    {display: '點擊數(shù)', name : 'clicks', width : 80, sortable : true, align: 'left'},
    {display: '曝光數(shù)', name : 'impressions', width : 80, sortable : true, align: 'left'},
    {display: '分析', name : 'impressions', width : 80, sortable : true, align: 'left'}
    ],
      sortname: "advName",
   sortorder: "asc",
   usepager: true,
   useRp: true,   
   title: '統(tǒng)計期間該合同廣告位投放',
   showTableToggleBtn: true,
   width: 1000,
   height: 200
   }
 );  
后臺java代碼(struts2),由于框架不同代碼有可能不同,我這里一次查出了所有需要數(shù)據(jù),沒有考慮分頁,需要分頁的話,請將page 等信息傳入后來查詢。
/**
  * 用于結(jié)合flexigrid實現(xiàn)可選表格
  * @return
  */
 public String getAllJsonData() {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  ContractReportService service = (ContractReportService) SpringHelper
  .getBean(TMG_REPORTS_CONTRACT);
  Map map = new HashMap();
  map.put("contractId", contractId);
  map.put("startdate", startDate);
  map.put("enddate", endDate);
  list = service.getAdvListbyContract(map);
  try {
  List mapList = new ArrayList();  
  for(int i = 0; i < list.size(); i++) { 
     Map cellMap = new HashMap(); 
     ContractReport cr = (ContractReport)list.get(i);
           cellMap.put("cell", new Object[] {cr.getAdvName(), formatter.format(cr.getStart()), formatter.format(cr.getEnd()), cr.getClicks(), cr.getImpressions(),"<img alt='分析' src='../image/analyse.gif'>"});    
           mapList.add(cellMap);  
  }
     Map pageInfo = new HashMap();     
     pageInfo.put("rows", mapList);
     JSONObject object = new JSONObject();  
     object.accumulateAll(pageInfo);
     Struts2Utils.getResponse().setContentType("text/x-json");
     Struts2Utils.getResponse().setCharacterEncoding("UTF-8");
     Struts2Utils.getResponse().setHeader("Cache-Control", "no-cache");
     Struts2Utils.getResponse().getWriter().write(object.toString());
     Struts2Utils.getResponse().getWriter().flush();
     Struts2Utils.getResponse().getWriter().close();
  } catch (IOException e) {
   e.printStackTrace();
  }
  return null;
 }
 最后上圖(用highcharts和flexigrid實現(xiàn)):


Mon$ter! 2011-07-26 20:18 發(fā)表評論
]]>
學(xué)習(xí)基于jQuery的FlexiGrid工具(3)APIhttp://www.aygfsteel.com/moster/archive/2011/07/26/355077.htmlMon$ter!Mon$ter!Tue, 26 Jul 2011 11:15:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/26/355077.htmlhttp://www.aygfsteel.com/moster/comments/355077.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/26/355077.html#Feedback0http://www.aygfsteel.com/moster/comments/commentRss/355077.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/355077.html閱讀全文

Mon$ter! 2011-07-26 19:15 發(fā)表評論
]]>
學(xué)習(xí)基于jQuery的FlexiGrid工具(2)一處報錯的處理http://www.aygfsteel.com/moster/archive/2011/07/26/355060.htmlMon$ter!Mon$ter!Tue, 26 Jul 2011 06:37:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/26/355060.htmlhttp://www.aygfsteel.com/moster/comments/355060.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/26/355060.html#Feedback0http://www.aygfsteel.com/moster/comments/commentRss/355060.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/355060.htmlmyeclipse中一處報錯,$(this.colCopy).css({
Title      position: 'absolute',
      'float': 'left',
      display: 'none',
      textAlign: obj.align
     });

修改一下就OK了:
Title$(this.colCopy).css({
      position: 'absolute',
      'float': 'left',
      'display': 'none',
      textAlign: obj.align
     });


Mon$ter! 2011-07-26 14:37 發(fā)表評論
]]>
學(xué)習(xí)基于jQuery的FlexiGrid工具http://www.aygfsteel.com/moster/archive/2011/07/26/355053.htmlMon$ter!Mon$ter!Tue, 26 Jul 2011 05:17:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/26/355053.htmlhttp://www.aygfsteel.com/moster/comments/355053.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/26/355053.html#Feedback5http://www.aygfsteel.com/moster/comments/commentRss/355053.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/355053.html閱讀全文

Mon$ter! 2011-07-26 13:17 發(fā)表評論
]]>
JS 動態(tài)添加列表框項效果代碼http://www.aygfsteel.com/moster/archive/2011/07/25/354984.htmlMon$ter!Mon$ter!Mon, 25 Jul 2011 06:19:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/25/354984.htmlhttp://www.aygfsteel.com/moster/comments/354984.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/25/354984.html#Feedback0http://www.aygfsteel.com/moster/comments/commentRss/354984.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/354984.htmlhttp://www.jb51.net/article/19139.htm JS 動態(tài)添加列表框項效果代碼
詳細出處參考:http://www.jb51.net/article/19139.htm

http://www.jb51.net/article/27681.htm js 彈出層 并可以拖拽
詳細出處參考:http://www.jb51.net/article/27681.htm

 

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>彈出層并可拖拽</title>
<style>
html,body{height:100%;overflow:hidden;}
body,div,h2{margin:0;padding:0;}
body{font:12px/1.5 Tahoma;}
center{padding-top:10px;}
button{cursor:pointer;}
#overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#000;opacity:0.5;filter:alpha(opacity=50);display:none;}
#win{position:absolute;top:50%;left:50%;width:400px;height:200px;background:#fff;border:4px solid #f90;margin:-102px 0 0 -202px;display:none;}
h2{font-size:12px;height:18px;text-align:right;background:#FC0;border-bottom:3px solid #f90;padding:5px;cursor:move;}
h2 span{color:#f90;cursor:pointer;background:#fff;border:1px solid #f90;padding:0 2px;}
</style>
<script>
window.onload = function ()
{
var oWin = document.getElementById("win");
var oLay = document.getElementById("overlay");
var oBtn = document.getElementsByTagName("button")[0];
var oClose = document.getElementById("close");
var oH2 = oWin.getElementsByTagName("h2")[0];
var bDrag = false;
var disX = disY = 0;
oBtn.onclick = function ()
{
oLay.style.display = "block";
oWin.style.display = "block"
};
oClose.onclick = function ()
{
oLay.style.display = "none";
oWin.style.display = "none"

};
oClose.onmousedown = function (event)
{
(event || window.event).cancelBubble = true;
};
oH2.onmousedown = function (event)
{
var event = event || window.event;
bDrag = true;
disX = event.clientX - oWin.offsetLeft;
disY = event.clientY - oWin.offsetTop;
this.setCapture && this.setCapture();
return false
};
document.onmousemove = function (event)
{
if (!bDrag) return;
var event = event || window.event;
var iL = event.clientX - disX;
var iT = event.clientY - disY;
var maxL = document.documentElement.clientWidth - oWin.offsetWidth;
var maxT = document.documentElement.clientHeight - oWin.offsetHeight;
iL = iL < 0 ? 0 : iL;
iL = iL > maxL ? maxL : iL;
iT = iT < 0 ? 0 : iT;
iT = iT > maxT ? maxT : iT;

oWin.style.marginTop = oWin.style.marginLeft = 0;
oWin.style.left = iL + "px";
oWin.style.top = iT + "px";
return false
};
document.onmouseup = window.onblur = oH2.onlosecapture = function ()
{
bDrag = false;
oH2.releaseCapture && oH2.releaseCapture();
};
};
</script>
</head>
<body>
<div id="overlay"></div>
<div id="win"><h2><span id="close">×</span></h2></div>
<center><button>彈出層</button></center>
</body>
</html>

 



Mon$ter! 2011-07-25 14:19 發(fā)表評論
]]>
使用 Lotus Forms JavaScript API 與 Web 頁面中的 XFDL 表單交互(轉(zhuǎn)itpub)http://www.aygfsteel.com/moster/archive/2011/07/25/354974.htmlMon$ter!Mon$ter!Mon, 25 Jul 2011 04:30:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/25/354974.htmlhttp://www.aygfsteel.com/moster/comments/354974.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/25/354974.html#Feedback0http://www.aygfsteel.com/moster/comments/commentRss/354974.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/354974.html簡介: IBM Lotus Forms 是 IBM 推出的電子表單解決方案,用于自動化基于紙質(zhì)的流程,減少處理時間和出錯概率,提高流程處理效率。其中,Webform. Server 和 Viewer 作為用于展現(xiàn)表單的產(chǎn)品,為用戶提供了在桌面上和瀏覽器中查看和操作表單的功能。除此之外,這兩個產(chǎn)品還提供了 JavaScript. API,用于 HTML 頁面簡單方便地與 XFDL 表單進行交互,大大提高了 Lotus Forms 二次開發(fā)的速度。

概述

JavaScript. API 是用于通過編程與 Web 頁面中嵌入的 XFDL 表單交互的一組工具。通過 JavaScript. API,可以把一個已存在的靜態(tài)表單轉(zhuǎn)變?yōu)榻换ナ降膭討B(tài)表單,非常容易地將 Lotus Forms 與其他應(yīng)用集成。展示在 IBM Lotus Forms Viewer 和 IBM Lotus Forms Server – Webform. Server 中的表單都可以使用 JavaScript. API 進行控制和操作。JavaScript. API 允許我們使用熟悉的 JavaScript. 工具創(chuàng)建 HTML 頁面,與現(xiàn)有的 XFDL 表單進行動態(tài)交互,使用腳本在表單中插入或修改數(shù)據(jù)以及從表單中提取數(shù)據(jù)。

可以使用 JavaScript. API 直接訪問整個表單及其所有元素節(jié)點。JavaScript. API 提供了操作表單中的輸入框等控件的功能。可以從嵌入 Web 頁面中的 XFDL 表單中提取信息,使用 JavaScript. 代碼加工處理,然后返回給同一個表單或同一個 Web 頁面中的其他表單。另外,也可以從表單中獲取數(shù)字簽名的信息,然后加以驗證或進行其他操作。

圖 1 展示了在 HTML 頁面中使用 JavaScript. API 與 XFDL 表單交互的過程。


圖 1. HTML 頁面中使用 JavaScript. API 與 XFDL 表單交互的過程
圖 1. HTML 頁面中使用 JavaScript. API 與 XFDL 表單交互的過程

FormNodeP 對象和 XFDL 對象是 JavaScript. API 的主要組成部分,下面將對其進行詳細介紹。


FormNodeP 對象

表單中的每個 XFDL 元素都對應(yīng)一個 FormNodeP 對象,在加載表單的時候,代表表單本身的 FormNodeP 對象會被添加到 ibmForms 數(shù)組中。調(diào)用 JavaScript. API 的應(yīng)用可以使用 ibmForms 數(shù)組作為起點。FormNodeP 對象包含了操作和控制表單的方法。可用于添加、修改、刪除和驗證表單內(nèi)容。任何使用 FormNodeP 對象中的方法的 Web 頁面必須在腳本中包含 LF_FormNodeP.js 文件。FomNodeP 對象中的方法可以分為以下幾類:

  • 事件相關(guān)的方法:JavaScript. API 支持四種事件,即 onBlur、 onChange、 onClick 和 onFocus 事件。在 FormNodeP 對象中包含了對這四類事件的處理函數(shù)注冊和注銷方法。
  • 表單頁面元素及其屬性:可以使用 FormNodeP 中的方法讀取、添加和修改表單頁面元素及其屬性,例如為 combobox、list 或 popup 添加一個選項,復(fù)制或刪除一個表單頁面元素,或者操作表單中的附件等等。
  • Form. instance:可以使用 FormNodeP 提供的相關(guān)方法獲取或更新 form. instance,包括 XForms instance 和 XML model。
  • 數(shù)字簽名:FormNodeP 提供了用于驗證或刪除表單中的數(shù)字簽名的功能。

XFDL 對象

XFDL 對象包含從 Web 頁面中注冊和注銷表單的功能。為了使用 JavaScript. API,必須在腳本文件的開頭包含 LF_XFDL.js 文件。

XFDL 中的 registerAPIExceptionHandler 方法用于注冊處理 JavaScript. API 拋出的異常的函數(shù)。registerForm. 方法用于注冊表單,將其添加到 ibmForms 表單數(shù)組中,這樣 JavaScript. API 可以訪問該表單。deregisterForm. 方法用于注銷原來注冊的表單。調(diào)用該方法后,JavaScript. API 不可以繼續(xù)訪問該表單。


使用 JavaScript. API 創(chuàng)建與 Lotus Forms 表單交互的應(yīng)用

下面將通過一個實例展示如何使用 JavaScript. API 創(chuàng)建與 Lotus Forms 表單交互的 Web 應(yīng)用。

實例中的表單是采購系統(tǒng)中的一個簡化采購訂單表單,當(dāng)用戶選定一個商品時,表單中會自動顯示出商品的報價和生產(chǎn)廠商的名稱及圖標(biāo);用戶添加需要采購的商品后對表單進行數(shù)字簽名;HTML 頁面獲得采購訂單的數(shù)據(jù)和數(shù)字簽名的狀態(tài)后提交到后臺進行處理。下面將列舉本實例中使用 JavaScript. API 的幾段代碼。

本文中使用的完整表單及代碼詳見下載部分,可以使用 Lotus Forms Viewer 3.5.1 或 Lotus Forms Webform. Server 3.5.1 來打開該表單。

在使用 JavaScript. API 的腳本的開頭部分,包含需要的 JavaScript. API 文件:


清單 1.
<SCRIPT. TYPE="text/javascript" SRC="LF_XFDL.js"></SCRIPT> 
<SCRIPT. TYPE="text/javascript" SRC="LF_FormNodeP.js"></SCRIPT>


清單 2. 在加載表單后,注冊商品名稱改變事件
var theName = ibmForms["customFormName"].dereferenceEx(null, "PAGE1.LIST1", 
    0, FormNodeP.UFL_ITEM_REFERENCE, null); 
theName.addOnChange(updatePrice); 
theName.addOnChange(updateProducer); 
theName.addOnChange(updateProducerIcon);

用戶選定一個商品時,顯示商品的報價及生產(chǎn)廠商的名稱,代碼如下。


清單 3. 通過更新 Instance 中的節(jié)點更新商品的單價
function updatePrice() 
{ 
    ibmForms["customFormName"].
        updateXFormsInstance(null,"instance('Generated')/wizardpage2/price",
        null,"15.0", XFDL.UFL_XFORMS_UPDATE_REPLACE_TEXT) 
}


清單 4. 通過設(shè)置 XFDL 元素的值來更新生產(chǎn)廠商的名稱
function updateProducer() 
{ 
    ibmForms["customFormName"].setLiteralByRefEx(null, 
        "PAGE1.producer.value", 0, null, "IBM"); 
}

為了顯示生產(chǎn)廠商的圖標(biāo), 我們需要將圖標(biāo)圖片的數(shù)據(jù)以附件的形式添加到表單中,其 JavaScript. API 代碼如下。


清單 5. 添加圖片文件
function updateProducerIcon() 
{ 

    var pageone = ibmForms["customFormName"].dereferenceEx(null, 
        "PAGE1", 0, FormNodeP.UFL_PAGE_REFERENCE, null); 
	
    var imageEncode = 
        "H4sIAAAAAAAAC3P3dLOwTFRgUGA4xAAC////X8XwoYGh4QPDqg9A/
        uxMhtAPij9ZGEGSOiACpJaBuVRi151/BmyGS1uV7t/
        VKHcWKHIJ8HL+JfjGdF28zvkSWVGLZvFpgj/
        6YvUUnpjyMS5JlNSxau9uDmHMsZnPt+TJqzmF3Vv0r5zeqrC1X/
        vI88mLLj8wNa4U/
        JaSPLvO36jWSV9AR11as7HJqL2mRkSum0uyr190sikngzUAvLfe4rAAAAA="
	
    var encloseImage = pageone.encloseFile(imageEncode, 
        "base64-gzip", "image/gif", null, "DATA1"); 
 }

當(dāng)用戶完成采購訂單并進行數(shù)字簽名后,提交訂單,在提交訂單前,需要驗證數(shù)字簽名,如果數(shù)字簽名驗證函數(shù)的返回值為 FormNodeP.UFL_DS_OK,則表示數(shù)字簽名有效。


清單 6. 驗證數(shù)字簽名
function verifySign() 
{ 
	var signNode = ibmForms["customFormName"]
	    .dereferenceEx(null, "PAGE1.SIGNATURE1", 0, 
	    FormNodeP.UFL_ITEM_REFERENCE, null); 

	var ret = ibmForms["customFormName"].verifySignature(signNode, false); 
	
	return ret; 

}

該實例中使用的表單和代碼祥見附件。

有時,需要在同一個 Web 頁面中展示多個 XFDL 表單。當(dāng)在同一個 Web 頁面中同時展示多個 XFDL 表單時,如果使用 JavaScript. API 處理 XFDL 表單,需要使用表單的文件名來區(qū)分不同的表單,示例代碼如下。


清單 7. 多表單示例代碼
if (!ibmForms["customFormName"] || !ibmForms["Form2.xfdl"] || !ibmForms["Form3.xfdl"]) { 
    alert("You must select a form. before you can start any tests..."); 
}


異常和錯誤處理

在使用 Lotus Forms Javascript. API 時,有兩個發(fā)生異常的根源,一個是 JavaScript. 代碼,另一個是 Viewer 或 Webform. server 中的底層表單處理代碼。

可以使用常規(guī)的方式處理 JavaScript. 代碼錯誤。例如,保持瀏覽器的默認(rèn)行為或者使用 JavaScript. 的 try-catch 方式進行處理。

JavaScript. API 的錯誤處理機制用于處理底層表單代碼拋出的異常。這些異常可以以 JavaScript. 警告的方式顯示,或者傳遞到自定義的異常處理器。可以使用 XFDL 對象的 registerAPIExceptionHandler 方法注冊自定義的異常處理方法。自定義的異常處理方法應(yīng)該以 JavaScript. 錯誤對象 ex 做為輸入?yún)?shù) , 實例代碼如下。


清單 8. 用戶自定義的異常處理示例代碼
function apiExceHandler(ex) { 

    alert("custom error handling"); 
    alert("name: " + ex.name); 
    var exDesc =  ex.description; 
    alert("description: " + exDesc); 
    var exMsg =  ex.message 
    alert("message: " + exMsg); 
}


Viewer 和 Webform. Server 中實現(xiàn)的區(qū)別

很多時候,不管表單是由 Viewer 展示還是 Webform. Server,其使用 JavaScript. API 的方式是相同的。但是,有時可能需要根據(jù)選擇使用 Viewer 還是 Webform. Server 調(diào)整應(yīng)用的設(shè)計。

由于實現(xiàn)機制的不同,當(dāng)使用 Webform. Server 展示表單時,使用 JavaScript. API 的應(yīng)用可能有以下某些局限。

  • Web 頁面加載:在表單沒有完全加載到瀏覽器并注冊前,不能使用 JavaScript. API。但是,瀏覽器并不能控制頁面中不同部分的加載順序,即不能保證在 JavaScript. 應(yīng)用訪問表單前表單已經(jīng)加載完成并注冊。對于這種情況,Portlet 和 Servlet 分別有其不同的解決方法。當(dāng)使用 Portlet 時,可以通過使用兩個 Portlet 來解決,一個 Portlet 用于展示 XFDL 表單,另一個 Portlet 中提供用戶控制 JavaScript. 應(yīng)用的初始化的機制。當(dāng)使用 Servlet 時,可以通過把 Web 頁面劃分成不同的 frame. 來解決。Frameset 元素的 onload 事件在所有 frame. 加載完成后發(fā)生,可以用于控制 JavaScript. 應(yīng)用的初始化。
  • Web 頁面重新加載:盡管 Webform. server 中廣泛使用了 AJAX,但是某些操作仍然會引起頁面刷新,當(dāng)頁面刷新并重新加載后,JavaScript. 的狀態(tài)信息會丟失,變量值和存儲的任何其它數(shù)據(jù)都會丟失。在 Servlet 中,可以使用 HTML frame. 來處理這種局限。Portlet 中則會比較復(fù)雜。需要采取措施以在頁面重新加載時保存 JavaScript. 應(yīng)用的狀態(tài)。

總結(jié)

本文在介紹了 Lotus Forms JavaScript. API 后,結(jié)合實例向用戶詳細地介紹了如何使用 JavaScript. API 與 XFDL 表單動態(tài)交互,進行 Lotus Forms 的二次開發(fā)以及與其他系統(tǒng)的集成。本文還總結(jié)了 Lotus Forms JavaScript. API 中的異常和錯誤處理機制。最后,文章列舉了使用 Lotus Forms Webform. Server 的 JavaScript. API 的應(yīng)用需要注意的局限及其解決方法。

原文鏈接:http://www.ibm.com/developerworks/cn/lotus/forms-javascript-api/index.html




Mon$ter! 2011-07-25 12:30 發(fā)表評論
]]>
JS動態(tài)對表單進行添加和修改http://www.aygfsteel.com/moster/archive/2011/07/25/354966.htmlMon$ter!Mon$ter!Mon, 25 Jul 2011 03:23:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/25/354966.htmlhttp://www.aygfsteel.com/moster/comments/354966.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/25/354966.html#Feedback2http://www.aygfsteel.com/moster/comments/commentRss/354966.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/354966.htmlhttp://hi.baidu.com/supersolon/blog/item/c07bca86cf9307b26d8119e6.html JS動態(tài)對表單進行添加和修改

http://hi.baidu.com/supersolon/blog/item/7a52c6562cebb9030df3e3e5.html JS實現(xiàn)區(qū)域打印,去頁眉頁腳
Title

<%@ page language="java" contentType="text/html;charset=GBK"
import="java.util.Date"%>


<%@ taglib uri="<%@ taglib uri="<%@ taglib uri="<%@ taglib uri="

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
<head>
<title>市局辦公用品-新個人申領(lǐng)</title>
<fmt:setBundle basename="MyResource" scope="session" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="<fmt:message key='StylePath' />style.css" rel="stylesheet"
   type="text/css">
<script type="text/javascript"
   src="<fmt:message key='JavaScriptPath' />common.js"></script>
<script language="javascript"
   src="<fmt:message key='JavaScriptPath' />meizzDate.js"></script>
<script language="JavaScript"
   src="<fmt:message key='JavaScriptPath' />GetDate.js"></script>
<script language="JavaScript" src="common/js/dojo/dojo.js"></script>
<script type='text/javascript'
   src='<%=request.getContextPath()%>/dwr/interface/OfficeSuppliesLogic.js'></script>
<script type='text/javascript'
   src='<%=request.getContextPath()%>/dwr/engine.js'></script>
<script language="javascript"
   src="<c:out value="${pageContext.request.contextPath}"/>/common/js/js_select.js"></script>
<script language="javascript">
//dwr.engine.setAsync(false);
var csbh="<c:out value="${sessionScope.currentUserData.csbh}"/>";
var goodsindex=0;
   function submitButton(obj)
{
if(obj.value==""){
return;
}
OfficeSuppliesLogic.queryGoods(obj.value,csbh,setGoods);
}
function handleSetSelectIndexAsValue(destSideId,value){
       var destSide=document.getElementById(destSideId);
    if(destSide==null)return;
    for(var j=0;j<destSide.options.length; j++){
   if(destSide.options[j].value==value){
       destSide.selectedIndex=j;
      break;
    } 
  }
 
 }


function setGoods(data){
   handleRemoveAll("goods");

if(data==null ||data=='null'){return;}

for(var i=0;i<data.length;i++){
var officeSuppliesModel=data[i];

if(officeSuppliesModel==null ||officeSuppliesModel=='null' ){continue;}

var goodsId=officeSuppliesModel.id;
var goodsName=officeSuppliesModel.name;
var goodsUnit=officeSuppliesModel.unit;
handleAdd("goods",goodsId+"|"+goodsUnit,goodsName);
     }
   }

function backClick()
{
    document.forms[0].method.value="queryExamePersonSuppliesByUser";
   return true;
}
function saveClick()
{
   document.forms[0].typeName.value=document.forms[0].typeId.options[document.forms[0].typeId.selectedIndex].text;
   document.forms[0].goodsName.value=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].text;
   count=document.forms[0].goodsName.value;
   if(count==null || count.length<=0)
   {
    alert('物品名稱不能為空!');
    document.forms[0].goodsName.value='';
    return false;
   }
   count=document.forms[0].applyCount.value;
   if(count==null || count<='0')
   {
    alert('數(shù)量不能小(等)于零或為空!');
    document.forms[0].applyCount.value='';
    return false;
   }
  
   return true;
}
function startClick()
{
    var checknum=0;
    var checkBoxs=document.getElementsByName("applyid");
    for(var i=0;i<checkBoxs.length;i++){
        
           if(checkBoxs[i].checked){
     
             checknum=checknum+1;
           }
      }
     
      if(checknum==0){
       alert("可提交的申請項為空,請選擇申請項后進行提交!");
       return false;
      }
   document.forms[0].method.value="createPersonSuppliesDraw";

   return true;
}
    function goodChange()
    {
        var val=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].value;
   var arry=val.split('|');
   try{
        document.forms[0].unit.value=arry[1];
         document.forms[0].goodsId.value=arry[0];
     
    if(document.getElementById('display').hasChildNodes())
         {
             document.getElementById('display').removeChild(document.getElementById('display').childNodes[0]);
         }
      //   document.getElementById('display').removeChild(document.getElementById('display'));
            document.getElementById('display').appendChild(document.createTextNode(arry[1]));
      
   }catch(e)
   {}
    }

function addGoods(){
if(!saveClick()){
return;
}
     var opertype=document.forms[0].opertype.value;
var typeName=document.forms[0].typeId.options[document.forms[0].typeId.selectedIndex].text;
     var typeId=document.forms[0].typeId.options[document.forms[0].typeId.selectedIndex].value;
     var goodsName=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].text;
   var goods_id="-1";
      var unit="";
   var val=document.forms[0].goods.options[document.forms[0].goods.selectedIndex].value;

   var arry=val.split('|');
   try{
         unit=arry[1];
         goods_id=arry[0];
           }catch(e)
   {}

     var applyCount=document.forms[0].applyCount.value;
    

var table=document.getElementById("bgyptable");
     if(opertype==""){
   var newTr = table.insertRow(table.rows.length-1);

                     newTr.id=goodsindex;
                     var newTd0 = newTr.insertCell();
      newTd0.className="table2_td";
                     newTd0.innerHTML=typeName+"<input type=hidden value='"+typeName+"' name='typeName_"+goodsindex+"'>"
                             +"<input type=hidden value='"+typeId+"' name='typeId_"+goodsindex+"'>";
                     var newTd1 = newTr.insertCell();
       newTd1.className="table2_td";
                     newTd1.innerHTML=goodsName+"<input type=hidden value='"+goodsName+"' name='goodsName_"+goodsindex+"'>"
                             +"<input type=hidden value='"+goods_id+"' name='goods_id_"+goodsindex+"'>"
                             +"<input type=hidden value='"+unit+"' name='unit_"+goodsindex+"'>";  
         
       var newTd3 = newTr.insertCell();
        newTd3.className="table2_td";
                     newTd3.innerHTML=applyCount+unit+"<input type=hidden value='"+applyCount+"' name='applyCount_"+goodsindex+"'>";   
     
      var newTd6 = newTr.insertCell();
      newTd6.className="table2_td";
                     newTd6.innerHTML="<span onclick='javascript:setModify(this.parentElement.parentElement)'>修改</span><input type=checkbox value='"+goodsindex+"' name='applyid' checked='true'>";
            goodsindex=goodsindex+1;
}else{

    for(var i=0;i<table.rows.length-1;i++){
     obj=table.rows[i];
   
     if(obj.cells.length<3||obj.cells[3].getElementsByTagName("input").length==0||obj.cells[3].getElementsByTagName("input")[0].type!="checkbox"){
     continue;
     }
    var rowid=obj.cells[3].getElementsByTagName("input")[0].value;
    if(rowid==opertype){
   obj.cells[0].innerHTML=typeName+"<input type=hidden value='"+typeName+"' name='typeName_"+rowid+"'>"
                             +"<input type=hidden value='"+typeId+"' name='typeId_"+rowid+"'>";
   obj.cells[1].innerHTML=goodsName+"<input type=hidden value='"+goodsName+"' name='goodsName_"+rowid+"'>"
                             +"<input type=hidden value='"+goods_id+"' name='goods_id_"+rowid+"'>"
                             +"<input type=hidden value='"+unit+"' name='unit_"+rowid+"'>";  
     
      obj.cells[2].innerHTML=applyCount+unit+"<input type=hidden value='"+applyCount+"' name='applyCount_"+rowid+"'>";   
     
    
     document.forms[0].opertype.value="";
     document.getElementById("okbutton").value="增加到申請列表";

    }   
   
    }

    }

    document.forms[0].applyCount.value="";

   // document.forms[0].guige.value="";
//document.forms[0].typeId.selectedIndex=0;
//document.forms[0].goods.selectedIndex=0;

}

function setModify(obj){
   var id=obj.cells[3].getElementsByTagName("input")[0].value;  
    document.forms[0].opertype.value=id;

     document.forms[0].applyCount.value=obj.cells[2].getElementsByTagName("input")[0].value;
  
     //document.forms[0].guige.value=obj.cells[3].getElementsByTagName("input")[0].value;
     handleSetSelectIndexAsValue("typeId",obj.cells[0].getElementsByTagName("input")[0].value);
submitButton(document.getElementById("typeId"));
handleSetSelectIndexAsValue("goods",obj.cells[1].getElementsByTagName("input")[1].value+"|"+obj.cells[1].getElementsByTagName("input")[2].value);
document.getElementById("okbutton").value="確定";
}
   
</script>
</head>
<body>
<!--------------以下Table為路徑-------->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td height="30" class="place">
     <img src="<fmt:message key='CommonImagePath' />place_btn.gif"
      width="12" height="11">
     當(dāng)前位置:北京市藥監(jiān)局 >> 輔助辦公 >> 辦公用品申請
    </td>
   </tr>
   <tr>
    <td height="10">
    </td>
   </tr>
</table>
<!--------------Table為路徑結(jié)束-------->


<table width="95%" border="0" align="center" cellpadding="0"
   cellspacing="0" class="table1_border">
   <tr>
    <td class="table1_head_title">
     <img src="<fmt:message key='CommonImagePath' />table1_head_ico.gif"
      width="26" height="23" align="absmiddle">
     辦公用品領(lǐng)用登記
    </td>
   </tr>
   <tr>
    <td class="table1_head_line">
    </td>
   </tr>

   <script>
   var count=0;
   </script>

 

   <tr>
    <td align="center">

     <html:form action="/exameOfficeSupplies">

      <html:hidden property="method" value="createPersonSuppliesDraw" />
      <html:hidden property="applyUserId" />
      <html:hidden property="applyUserName" />
      <html:hidden property="applyDeptId" />
      <html:hidden property="applyDeptName" />
      <html:hidden property="goodsName" />
      <html:hidden property="typeName" />
      <html:hidden property="unit" />
      <html:hidden property="priceIsAdmin" />


      <input type="hidden" name="unit" />

      <input type="hidden" name="atid" />
      <input type="hidden" name="tid" />
      <input type="hidden" name="selPeoType" />

      <table id="bgyptable" align="center" width="90%" border="0"
       align="center" cellpadding="0" cellspacing="1"
       class="table2_border">

       <tr>
        <td class="table2_td_title" width="15%">
         所屬類別
        </td>
        <td class="table2_td_title" width="15%">
         名稱
        </td>

        <td class="table2_td_title" width="15%">
         數(shù)量
        </td>

        <td class="table2_td_title" width="10%">
         是否提交
        </td>
       </tr>


       <tr>
        <td class="table2_td">
         <input id="opertype" name="opertype" type=hidden value="">
         <select id="typeId" name="typeId" tmpid="2"
          onchange="submitButton(this);">
          <option />
           <c:forEach items="${typeList}" var="OfficeSuppliesTypeModel">
            <option
             value="<c:out value="${OfficeSuppliesTypeModel.id}"/>"
             <c:if test="${OfficeSuppliesTypeModel.id==typeId}">
                selected
               </c:if> />
             <c:out value="${OfficeSuppliesTypeModel.sort}" />
            </option>

           </c:forEach>
         </select>
        </td>
       
        <td class="table2_td">

         <INPUT type="hidden" name="goodsId_2">
         <select id="goods" name="goods" onchange="goodChange(this);">
          <option />
           <c:forEach items="${goodsList}" var="OfficeSuppliesModel">
            <option
             value="<c:out value="${OfficeSuppliesModel.id}"/>|<c:out value="${OfficeSuppliesModel.unit}"/>"
             <c:if test="${OfficeSuppliesModel.id==officeSuppliesDrawForm.goods_id}">
              selected </c:if> />
             <c:out value="${OfficeSuppliesModel.name}" />
            </option>
           </c:forEach>
         </select>
        </td>


        <td class="table2_td">
         <input type=text name="applyCount" size="6" maxlength="20" />

        </td>


        <td class="table2_td">
         <input id="okbutton" type="button" value="增加到申請列表"
          onclick="javascript:addGoods()">
        </td>
       </tr>
      </table>


      <table align="center" width="90%" border="0" align="center"
       cellpadding="0" cellspacing="1" class="table2_border">

       <tr>
        <td align="center" class="table2_btn" colspan="6">
         <input type="image"
          src="<fmt:message key='CommonImagePath' />btnSubmit.gif"
          onclick="return startClick()">
         &nbsp;

         <input type="image"
          src="<fmt:message key='CommonImagePath' />btnBack.gif"
          onclick="return backClick()">


        </td>
       </tr>
      </table>
      <%@include file="../common/getDisplayParams1.jsp"%>
      <!-- 維護視圖狀態(tài)的隱藏域 -->
      <!-- 維護視圖狀態(tài)的隱藏域 -->
     </html:form>

    </td>
   </tr>
</table>

 

</body>

</html:html>



Mon$ter! 2011-07-25 11:23 發(fā)表評論
]]>
在javascript文件中使用jstl標(biāo)簽【2】JS實現(xiàn)區(qū)域打印,去頁眉頁腳http://www.aygfsteel.com/moster/archive/2011/07/25/354960.htmlMon$ter!Mon$ter!Mon, 25 Jul 2011 02:44:00 GMThttp://www.aygfsteel.com/moster/archive/2011/07/25/354960.htmlhttp://www.aygfsteel.com/moster/comments/354960.htmlhttp://www.aygfsteel.com/moster/archive/2011/07/25/354960.html#Feedback0http://www.aygfsteel.com/moster/comments/commentRss/354960.htmlhttp://www.aygfsteel.com/moster/services/trackbacks/354960.htmlhttp://hi.baidu.com/supersolon/blog/item/7a52c6562cebb9030df3e3e5.html

//此網(wǎng)頁內(nèi)容實現(xiàn)了用JS的方法進行區(qū)域打印,去除頁眉頁腳,添加控件進行預(yù)覽等功能。

Title

<%@ page language="java" contentType="text/html;charset=gbk"
import="java.util.Date"%>
<%@ taglib uri="<%@ taglib uri="<%@ taglib uri="<%@ taglib uri="<%@ taglib uri="

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>

<head>
<title>處理用車申請</title>
<fmt:setBundle basename="MyResource" scope="session" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="<fmt:message key='StylePath' />style.css" rel="stylesheet"
   type="text/css">
<script type="text/javascript"
   src="<fmt:message key='JavaScriptPath' />common.js"></script>
<script language="javascript"
   src="<fmt:message key='JavaScriptPath' />meizzDate.js"></script>
<script language="JavaScript"
   src="<fmt:message key='JavaScriptPath' />GetDate.js"></script>

<style type="text/css" media="print">
   .noPrint{display:none}
</style>

<script language="javascript">

var hkey_root,hkey_path,hkey_key;
    var hkey_root = "HKEY_CURRENT_USER";
var hkey_path = "\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";

//設(shè)置網(wǎng)頁打印的頁眉頁腳為空
function pagesetup_null()
{

    var RegWsh = new ActiveXObject("WScript.Shell");
    hkey_key="header";
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
    hkey_key="footer";
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"");
}
//設(shè)置網(wǎng)頁打印的頁眉頁腳為默認(rèn)值s
function pagesetup_default()
{
try{
    var RegWsh = new ActiveXObject("WScript.Shell")
    hkey_key="header"
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&w&b頁碼,&p/&P")
    hkey_key="footer"
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&u&b&d")
}catch(e){}
}
   
<!--此函數(shù)是為了解決全屏打印另外的一個打印函數(shù)-->
<!--printFunction()-->

function doPrint(oper) {
   if (oper < 10){
pagesetup_null();
bdhtml = window.document.body.innerHTML;//獲取當(dāng)前頁的html代碼
sprnstr = "<!--startprint"+oper+"-->";//設(shè)置打印開始區(qū)域
eprnstr = "<!--endprint"+oper+"-->";//設(shè)置打印結(jié)束區(qū)域
prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr)+18); //從開始代碼向后取html

prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//從結(jié)束代碼向前取html
window.document.body.innerHTML=prnhtml;

window.print();
pagesetup_default();
//window.document.all.wb.ExecWB(7,1);
//window.document.body.innerHTML=bdhtml;
} else{
pagesetup_null();
window.print();
pagesetup_default();
}

}

function preview(){
   var button=document.all.button
   button.style.display="none";
   var wb = document.all.wb;
       wb.ExecWB(7,1);
       button.style.display="block";
      
  
}

function dtPrint(){
if(window.print){
pagesetup_null();  
var print=document.all.print.innerHTML;
//var wb=document.all.wb;
//wb.ExecWB(7,1);
//var button=print.all.button;
// button.style.display="none";
document.body.innerHTML=print;  
window.print();
// document.all.button.display="block";
   pagesetup_default();
}
}



function issuanceClick()
{
   document.forms[0].method.value="submitMeetingRoomApp";
  
   validateMeetingRoomDisInfoShForm(document.forms[0]);
   document.forms[0].submit();
}
function backClick()
{
     document.forms[0].method.value="queryCarServiceInfo";
     return true;
}
function approveClick()
{
  
   document.forms[0].method.value="approveCarApp";
   return validatecarAppForm(document.forms[0]);
  
  
}
function returnClick()
{
   document.forms[0].method.value="returnCarApp";
   return validatecarAppForm(document.forms[0])
}
function saveClick()
{
  
   document.forms[0].method.value="saveCarAppOpinion";
   return validatecarAppForm(document.forms[0]);
  
  
}
</script>
</head>

 


<body>

<!--------------以下Table為路徑-------->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td height="30" class="place">
     <img src="<fmt:message key='CommonImagePath' />place_btn.gif"
      width="12" height="11">
     當(dāng)前位置:北京市藥監(jiān)局 >> 輔助辦公 >> 后勤管理 >> 處理用車申請
    </td>
   </tr>
   <tr>
    <td height="10" class="info">
     <c:if test="${requestScope.sign != null}">
      <br>
     &nbsp;&nbsp;&nbsp;    提示信息:<c:out value="${requestScope.sign}" />

     </c:if>
    </td>
   </tr>
</table>
<!--------------Table為路徑結(jié)束-------->


<table width="95%" border="0" align="center" cellpadding="0"
   cellspacing="0" class="table1_border">
   <tr>
    <td class="table1_head_title">
     <img src="<fmt:message key='CommonImagePath' />table1_head_ico.gif"
      width="26" height="23" align="absmiddle">
     處理用車申請
    </td>
   </tr>
   <tr>
    <td height="10">

    </td>
   </tr>
   <tr>
    <td align="center">
     <html:javascript formName="carAppForm" />
     <html:errors />
     <html:form action="/draftCarApp" method="POST">
      <html:hidden property="method" value="saveCarServiceInfo" />
      <html:hidden property="csId" />
      <html:hidden property="ciId" />
      <html:hidden property="licensePlateNum" />
      <html:hidden property="appPerson" />
      <html:hidden property="nonceState" />
      <html:hidden property="masterSign" />
      <html:hidden property="useCarRequire" />
      <html:hidden property="masterSign" />
      <html:hidden property="piId" />
      <html:hidden property="useCarDate_web" />

      <br />

      <!--startprint1-->
      <div id=print>
       <OBJECT id="wb" height='0' width='0'
        classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" name="wb"></OBJECT>

       <table align="center" width="90%" border="0" align="center"
        cellpadding="0" cellspacing="1" class="table2_border">
        <tr>
         <td width="30%" class="table2_td_title">
          申請人:
         </td>
         <td class="table2_td">
          <html:hidden property="appPerId" />
          <html:hidden property="appPerson" />
          <c:out value="${carAppForm.appPerson}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          申請人所在部門:
         </td>
         <td class="table2_td">
          <html:hidden property="useCarDeptId" />
          <html:hidden property="useCarDept" />
          <c:out value="${carAppForm.useCarDept}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          用車原因:
         </td>
         <td class="table2_td">
          <html:hidden property="useCarCause" />
          <c:out value="${carAppForm.useCarCause}" />
         </td>
        </tr>

        <tr>
         <td width="30%" class="table2_td_title">
          用車要求:
         </td>
         <td class="table2_td">
          <html:hidden property="useCarRequire" />
          <c:forEach items="${worktypeList}" var="ParameterModel">
           <c:if
            test="${carAppForm.useCarRequire == ParameterModel.parameterID}">
            <c:out value="${ParameterModel.parameterValue}" />
           </c:if>
          </c:forEach>
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          人數(shù):
         </td>
         <td class="table2_td">
          <html:hidden property="perAmount" />
          <!-- <img width="16" height="16" name="tan1" border="0" src="<fmt:message key='CommonImagePath' />tan.gif" onClick="getTime('leaveDate',1);" alt="">-->
          <c:out value="${carAppForm.perAmount}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          出發(fā)地點:
         </td>
         <td class="table2_td">
          <html:hidden property="leavePlace" />
          <!-- <img width="16" height="16" name="tan1" border="0" src="<fmt:message key='CommonImagePath' />tan.gif" onClick="getTime('leaveDate',1);" alt="">-->
          <c:out value="${carAppForm.leavePlace}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          到達地點:
         </td>
         <td class="table2_td">
          <html:hidden property="destination" />
          <!-- <img width="16" height="16" name="tan1" border="0" src="<fmt:message key='CommonImagePath' />tan.gif" onClick="getTime('leaveDate',1);" alt="">-->
          <c:out value="${carAppForm.destination}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          出車時間:
         </td>
         <td class="table2_td">
          <html:hidden property="leaveDate" />
          <!-- <img width="16" height="16" name="tan1" border="0" src="<fmt:message key='CommonImagePath' />tan.gif" onClick="getTime('leaveDate',1);" alt="">-->
          <c:out value="${carAppForm.leaveDate}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          收車時間:
         </td>
         <td class="table2_td">
          <html:hidden property="arriveDate" />
          <!-- <img width="16" height="16" name="tan1" border="0" src="<fmt:message key='CommonImagePath' />tan.gif" onClick="getTime('arriveDate',1);" alt="">-->
          <c:out value="${carAppForm.arriveDate}" />
         </td>
        </tr>

        <tr>
         <td class="table2_td_title">
          備&nbsp;&nbsp;&nbsp;&nbsp;注:
         </td>
         <td class="table2_td">
          <html:hidden property="remark" />
          <c:out value="${carAppForm.remark}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          車牌號:
         </td>
         <td class="table2_td">
          <html:hidden property="licensePlateNum" />
          <c:out value="${carAppForm.licensePlateNum}" />
         </td>
        </tr>
        <tr>
         <td width="30%" class="table2_td_title">
          司機姓名:
         </td>
         <td class="table2_td">
          <html:hidden property="motormanId" />
          <html:hidden property="motormanName" />
          <c:out value="${carAppForm.motormanName}" />
         </td>
        </tr>

        <!--endprint1-->
        <tr class="">
         <td align="center" colspan="2" class="table2_btn">
          <a href="#"><img alt="單擊此按鈕 打印頁面" border=0
            name="imageField33"
            src="<fmt:message key='CommonImagePath' />btnPrint.gif"
            border="0" onclick="doPrint(1)" class="buttonImg"> </a>
          &nbsp;
          <input type="image" alt="單擊此按鈕 返回到列表頁面"
           src="<fmt:message key='CommonImagePath' />btnBack.gif"
           onclick="return backClick()">


         </td>
        </tr>
       
       </table>
      </div>
     
      <table width="90%" border="0" align="center" cellpadding="0"
       cellspacing="0" class="table3_border">
       <tr>
        <td class="table3_title">
         意見列表
        </td>
       </tr>
      </table>

      <table width="90%" border="0" align="center" cellpadding="0"
       cellspacing="0" class="table3_border">
       <tr>
        <td>

         <display:table name="opinionList" class="dpTable"
          style="width:100%" id="displayTable">

          <display:column property="stepName" title="步驟"
           style="width:20%;text-align:center" />
          <display:column property="name" title="處理人"
           style="width:20%;text-align:center" />
          <display:column title="處理時間"
           style="width:20%;text-align:center">
           <fmt:formatDate value="${displayTable.writeDate}"
            pattern="yyyy-MM-dd HH:mm" />
          </display:column>
          <display:column property="opinion" title="意見"
           style="width:40%;text-align:center" />

         </display:table>
         <!-- 用Diaplay Tag來顯示 -->
        </td>
       </tr>
      </table>
      <!-- 維護視圖狀態(tài)的隱藏域 -->
      <%@include file="../common/getDisplayParams1.jsp"%>
      <c:if test="${!empty param.nonceState_q}">
       <input type="hidden" name="nonceState_q"
        value="<c:out value="${param.nonceState_q}"/>">
      </c:if>
      <c:if test="${!empty param.useCarStartDate}">
       <input type="hidden" name="useCarStartDate"
        value="<c:out value="${param.useCarStartDate}"/>">
      </c:if>
      <c:if test="${!empty param.useCarEndDate}">
       <input type="hidden" name="useCarEndDate"
        value="<c:out value="${param.useCarEndDate}"/>">
      </c:if>
      <c:if test="${!empty param.useCarCause_q}">
       <input type="hidden" name="useCarCause_q"
        value="<c:out value="${param.useCarCause_q}"/>">
      </c:if>
      <!-- 維護視圖狀態(tài)的隱藏域 -->

     </html:form>

    </td>
   </tr>
</table>

 

</body>

</html:html>



Mon$ter! 2011-07-25 10:44 發(fā)表評論
]]>
主站蜘蛛池模板: 北碚区| 如皋市| 湟源县| 开平市| 茂名市| 香河县| 斗六市| 松溪县| 洱源县| 宁蒗| 确山县| 施秉县| 珲春市| 信阳市| 上林县| 浠水县| 新邵县| 宜阳县| 内黄县| 莆田市| 南涧| 双桥区| 鄢陵县| 兴安盟| 大港区| 泾阳县| 文登市| 清水河县| 广河县| 岱山县| 祁连县| 瑞安市| 兴宁市| 上饶县| 营山县| 酒泉市| 舟山市| 五莲县| 宜昌市| 河源市| 枣阳市|