class ALE_ExpenseReportUIBuilder extends SysOperationAutomaticUIBuilder//SrsReportDataContractUIBuilder
{
ALE_ExpenseReportContract contract;
SysLookupMultiSelectGrid multiSelect;
}
//
public void build()
{
contract = this.dataContractObject();
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmFromDate),contract);
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmToDate),contract);
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmWrkCtrId),contract);
//this.addDialogField(methodStr(ALE_ExpenseReportContract,parmWrkCtrGroupId),contract);
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmCheck),contract);
//super();
}
//
private void lookupWrkctrId(FormStringControl _formStringControl)
{
Query query;
QueryBuildDataSource datasource;
QueryBuildRange queryBuildRange;
if(_formStringControl != null)
multiSelect = SysLookupMultiSelectGrid::construct(_formStringControl,_formStringControl);
//SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(WrkCtrTable), _formStringControl);
query = new Query();
datasource = query.addDataSource(tableNum(WrkCtrTable));
queryBuildRange = datasource.addRange(fieldNum(WrkCtrTable,WrkCtrType));
//queryBuildRange.value(strFmt("%1, %2", Global::enum2int(WrkCtrType::Machine), Global::enum2int(WrkCtrType::Tool)));
//sysTableLookup.addLookupfield(fieldNum(WrkCtrTable,WrkCtrId));
//sysTableLookup.parmQuery(query);
//sysTableLookup.performFormLookup();
query.dataSourceTable(tableNum(WrkCtrTable)).addSelectionField(fieldNum(WrkCtrTable, WrkCtrId));
query.dataSourceTable(tableNum(WrkCtrTable)).addSelectionField(fieldNum(WrkCtrTable, Name));
multiSelect.parmQuery(query);
multiSelect.run();
//sysTableLookup.parmQuery(query);
}
//
public void postBuild()
{
DialogField resource;
DialogField resourceGroup;
super();
resource = this.bindInfo().getDialogField(this.dataContractObject(),
methodStr(ALE_ExpenseReportContract,parmWrkCtrId));
//resourceGroup = this.bindInfo().getDialogField(this.dataContractObject(),
// methodStr(ALE_ExpenseReportContract,parmWrkCtrGroupId));
resource.registerOverrideMethod(methodstr(FormStringControl, lookup), methodstr(ALE_ExpenseReportUIBuilder, lookupWrkctrId ), this);
//resourceGroup.registerOverrideMethod(methodstr(FormStringControl, lookup), methodstr(ALE_ExpenseReportUIBuilder, lookupWrkctrGroupId ), this);
}
//
public void postRun()
{
//super();
}
contract class// parm method use list
public List parmWrkCtrId(List _resouce = resource)
{
resource = _resouce;
return resource;
}
in Dp get the list value as follow
ListIterator resourceListIt;
resourceListIt = new ListIterator(contract.parmWrkCtrId());
while (resourceListIt.more())
{
resourceListIt.value();
..
..
resourceListIt.next();
}
{
ALE_ExpenseReportContract contract;
SysLookupMultiSelectGrid multiSelect;
}
//
public void build()
{
contract = this.dataContractObject();
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmFromDate),contract);
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmToDate),contract);
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmWrkCtrId),contract);
//this.addDialogField(methodStr(ALE_ExpenseReportContract,parmWrkCtrGroupId),contract);
this.addDialogField(methodStr(ALE_ExpenseReportContract,parmCheck),contract);
//super();
}
//
private void lookupWrkctrId(FormStringControl _formStringControl)
{
Query query;
QueryBuildDataSource datasource;
QueryBuildRange queryBuildRange;
if(_formStringControl != null)
multiSelect = SysLookupMultiSelectGrid::construct(_formStringControl,_formStringControl);
//SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(WrkCtrTable), _formStringControl);
query = new Query();
datasource = query.addDataSource(tableNum(WrkCtrTable));
queryBuildRange = datasource.addRange(fieldNum(WrkCtrTable,WrkCtrType));
//queryBuildRange.value(strFmt("%1, %2", Global::enum2int(WrkCtrType::Machine), Global::enum2int(WrkCtrType::Tool)));
//sysTableLookup.addLookupfield(fieldNum(WrkCtrTable,WrkCtrId));
//sysTableLookup.parmQuery(query);
//sysTableLookup.performFormLookup();
query.dataSourceTable(tableNum(WrkCtrTable)).addSelectionField(fieldNum(WrkCtrTable, WrkCtrId));
query.dataSourceTable(tableNum(WrkCtrTable)).addSelectionField(fieldNum(WrkCtrTable, Name));
multiSelect.parmQuery(query);
multiSelect.run();
//sysTableLookup.parmQuery(query);
}
//
public void postBuild()
{
DialogField resource;
DialogField resourceGroup;
super();
resource = this.bindInfo().getDialogField(this.dataContractObject(),
methodStr(ALE_ExpenseReportContract,parmWrkCtrId));
//resourceGroup = this.bindInfo().getDialogField(this.dataContractObject(),
// methodStr(ALE_ExpenseReportContract,parmWrkCtrGroupId));
resource.registerOverrideMethod(methodstr(FormStringControl, lookup), methodstr(ALE_ExpenseReportUIBuilder, lookupWrkctrId ), this);
//resourceGroup.registerOverrideMethod(methodstr(FormStringControl, lookup), methodstr(ALE_ExpenseReportUIBuilder, lookupWrkctrGroupId ), this);
}
//
public void postRun()
{
//super();
}
contract class// parm method use list
public List parmWrkCtrId(List _resouce = resource)
{
resource = _resouce;
return resource;
}
in Dp get the list value as follow
ListIterator resourceListIt;
resourceListIt = new ListIterator(contract.parmWrkCtrId());
while (resourceListIt.more())
{
resourceListIt.value();
..
..
resourceListIt.next();
}
No comments:
Post a Comment