首先从对话框取数赋值到窗体中时,有些可以成功赋值,有些却看不到?
原因:由于直接引用的是别人的做好的合同对话框,在返回值的list中没有加入此值,故找不到值
解决办法:在项目对话框的源码部分完善代码,如下所示:<xhtml:input id="returnAliasList" value="fContractName,fContractNum,fCICode,fCOCode,fPtName"
xui:parent="configViewDiv" xui:update-mode="insert"/>
其中,value部分为对话框页面可使用的值,
对话框中传递参数:
当需要在取得对话框中多个由关联的值时,需要用到系统提供的一个对对话框封装了的方法,
//在详细页中(使用trigger)
//trigger的点击事件,打开对话框
function trigger1DOMActivate(event){
var PersonDia = justep.xbl("mPersonDialog");
pmcSystem.useMappingResult(PersonDia, [{ //此方法为系统所封装的对话框方法
scopeData : "result",
scope : "all",
aimData : "noData",
operate : "updateCurrent",
locateMapping : null,
dataMapping : [{
name : "fNotifier",
value : "[result.psnName]"
},{
name : "ID",
value : "[result.psnID]"
}]
}], onRecord, onBegin, onEnd);
PersonDia.open();
}
function onBegin(dataId, beginData, store) {
return {ids: new Array(), names: new Array()}; //在begin函数中创建对象,来保存从对话框中选择的信息,此例为创建了两个数组作为一个对象存在
}
function onRecord(dataId, rowId, operate, beginData, store, record, srcRowId,
onGetSrcValueByText) {
beginData.ids.push(record.ID); //为创建的beginData对象下的两个数组赋值
beginData.names.push(record.fNotifier);
}
function onEnd(dataId, beginData, store) {
var dataXbl = justep.xbl("dataMain");
if(!dataXbl) return;
dataXbl.setValue("fNotifier", beginData.names.join("¡¢")); //取得对象中数据的元素name值,
//alert(beginData.ids.join(","));
}
//在grid列表中将Type 设为inputbtn 并加上该属性的onRender事件
function grdMainFPublishedRangeButtonClick(event){
var dlg = justep.xbl("publishedRangeDialog");
pmcSystem.useMappingResult(dlg,[{
scopeData : "result",
scope : "all" ,
aimData : "noData",
operate : "updateCurrent",
locateMapping : null,
dataMapping : [{
name : "fPublishedRange",
value : "[result.psnName]"
}]
}],onRecord,onBegin,onEnd);
dlg.open();
}
function onBegin(dataId,beginData,store){
return new Array();
}
function onRecord(dataId,rowId,operate,beginData,store,record,srcRowId,onGetSrcValueByText){
beginData.push(record.fPublishedRange);
}
function onEnd(dataId,beginData,store){
var dataXbl = justep.xbl("dataMain");
dataXbl.setValue("fPublishedRange",beginData.join(","));
}