zoukankan      html  css  js  c++  java
  • How to refresh datasource args caller[X++]

    To refresh  datasource args caller, you must add override method close on form
    like source code below :

    public void close()
    {
        FormRun         callerForm;
        ;
        callerForm          = element.args().caller();
        callerForm.dataSource().reread();
        // callerForm.dataSource().refresh();
       // -1 means refresh all records, the default is -2 which refreshes only certain specific records (eg marked)
       callerForm.dataSource().refreshEx();
       super(); }
        
        common = args.record();
        if (common.isFormDataSource())
        {
            formDataSource = common.dataSource();
    
            formDataSource.formRun().lock();
            formDataSource.reread();
            formDataSource.refreshEx();
            formDataSource.active();
            formDataSource.formRun().unLock();
        }

     AX2012 

    _dataSource.reread();
    trvExpTable_1_ds.research(true);

    cancel button

    void clicked()
    {
        trvExpTable trvExpTable;
        ;
        if( !element.THK_validateCancel(trvExpTable_1_ds, #TrvTableSelected))//1
            return;
    
        TrvPost::THK_cancelMultiple(trvExpTable_1_ds);
    
        trvExpTable_1_ds.research(true);
    
    }

    process class

    // VAR Changed on 10/12/2013 at 15:09:27 by THK7519 WO-PG020
    public static void THK_cancelMultiple(FormDataSource _formDataSource,
                                          boolean        _selectedAll = false)
    {
        trvExpTable buffer;
        trvExpTable trvExpTable;
    ;
        if(_formDataSource.table() != tableNum(trvExpTable))
            return;
        
        ttsBegin;
        if(!_selectedAll)
        {
            for (buffer = _formDataSource.getFirst(true) ? _formDataSource.getFirst(true) : _formDataSource.cursor(); buffer; buffer = _formDataSource.getNext())
            {
                trvExpTable = trvExpTable::find(buffer.ExpNumber, true);
                if(trvExpTable)
                {
                    trvExpTable.THK_PostStatus = THK_PostStatus::Cancelled;
                    trvExpTable.update();
                }
            }
        }
        else    // Post everything that's visible in the GRID
        {
            buffer = _formDataSource.getFirst();
            while(buffer)
            {
                trvExpTable = trvExpTable::find(buffer.ExpNumber, true);
                if(trvExpTable)
                {
                    trvExpTable.THK_PostStatus = THK_PostStatus::Cancelled;
                    trvExpTable.update();
                }
                buffer = _formDataSource.getNext();
            }
        }
        ttsCommit;
        _formDataSource.reread();
    }

     

  • 相关阅读:
    zookeeper集群的部署
    【转】始于Jupyter Notebooks:一份全面的初学者实用指南
    【转】Jupyter Notebook主题字体设置及自动代码补全
    【转】pip install 快速下载
    【转】Sublime Text 3 常用快捷键
    【转】Python——DataFrame基础操作
    【转】sqlite3 小结
    【转】SQLite3的安装与使用
    Python Pandas pandas.DataFrame.to_sql函数方法的使用
    处理异常 ‘try’——‘except’ 方法
  • 原文地址:https://www.cnblogs.com/Fandyx/p/3355719.html
Copyright © 2011-2022 走看看