Class SysTableBrowser
public void
run(tableId tableId,common tmpBuffer = null)
|
||||||||||
public void
run(tableId tableId)
|
||||||||||
{
Form tableBrowser;
Object formRun;
|
||||||||||
formRun fr;
|
||||||||||
FormBuildDesign formBuildDesign;
|
||||||||||
FormDataSource fds;
|
||||||||||
FormBuildDataSource formBuildDataSource;
FormBuildGridControl formBuildGridControl1;
FormBuildGridControl formBuildGridControl2;
FormGridControl formGridControl;
FormRadioControl formRadioControl;
DictTable dictTable;
Args args;
Args browserArgs;
int idx;
boolean hasAutoReportGroup;
;
dictTable = new DictTable(tableId);
//If the table is abstract, don't allow
creates in SysTableBrowser.
if(dictTable.isAbstract())
{
allowCreate = false;
}
browserArgs = new Args();
browserArgs.name(formstr(SysTableBrowser));
formRun =
classfactory.formRunClass(browserArgs);
|
||||||||||
|
||||||||||
tableBrowser = formRun.form();
|
||||||||||
formBuildDataSource =
tableBrowser.dataSource(1);
formBuildDataSource.name(dictTable.name());
formBuildDataSource.table(tableId);
formBuildDataSource.autoQuery(true);
formBuildDataSource.linkType(0);
formBuildDataSource.allowCreate(allowCreate);
formBuildDataSource.allowDelete(allowDelete);
formBuildDataSource.allowEdit(allowEdit);
formBuildDataSource.validTimeStateAutoQuery(ValidTimeStateAutoQuery::DateRange);
formBuildDataSource.validTimeStateUpdate(ValidTimeStateUpdate::Correction);
if (defaultIndexId)
{
formBuildDataSource.index(defaultIndexId);
}
formBuildDesign = tableBrowser.design();
formBuildDesign.caption("@SYS54191"
+ ': ' + dictTable.name());
formBuildDesign.widthMode(-1);
formBuildDesign.widthValue(#FormWidth);
formBuildDesign.heightMode(-1);
formBuildDesign.heightValue(#FormHeight);
formBuildGridControl1 = formBuildDesign.control('allFieldsGrid');
formBuildGridControl1.dataSource(dictTable.name());
formBuildGridControl1.allowEdit(allowEdit);
idx = formBuildGridControl1.id();
this.showAllFields(tableId,
formBuildGridControl1, formBuildDataSource);
formBuildGridControl2 =
formBuildDesign.control('autoReportGrid');
formBuildGridControl2.dataSource(dictTable.name());
formBuildGridControl2.allowEdit(allowEdit);
formBuildGridControl2.visible(false);
hasAutoReportGroup = this.showAutoFields(tableId,
formBuildGridControl2, formBuildDataSource);
args = new Args();
args.object(tableBrowser);
formRun =
classfactory.formRunClass(args);
|
||||||||||
|
||||||||||
formRun.enableCountryRegion(false);
|
||||||||||
if (tmpBuffer)
{
formRun.parmTmpData(tmpBuffer);
}
|
||||||||||
formRun.init();
formRun.parmTableId(tableId);
|
||||||||||
formRun.run();
|
||||||||||
fr=formRun;
fds=fr.dataSource(dictTable.name());
fds.executeQuery();
|
||||||||||
formRadioControl =
formRun.getRadioControl();
formRadioControl.visible(hasAutoReportGroup);
formGridControl = formRun.control(idx);
formGridControl.setFocus();
// This call is here as a hack fix
(AXSE:4564 or AX6:18807) for performance issue around Table Browser
// loading time, and should be removed
once a proper fix is in place.
formGridControl.autoSizeColumns(false);
formRun.detach();
}
form SysTableBrowser
//agregar
private void parmTmpData(common
tmpBuffer)
{
;
_tmpBuffer=tmpBuffer;
//modificar
///ejecutar
new SysTableBrowser().run(CommonBuffer.TableId, CommonBuffer);
|
jueves, 10 de enero de 2013
Utilizar SysTableBrowser para tablas temporales
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario