zoukankan      html  css  js  c++  java
  • How to achieve dialog with lookup control

    How to create a dialog with the lookup as a control, the other control SalesId ItemId lookup is the only thing that SalesId.

    Done as follows.
    1.declare control by extended data type to use.

    class LookupDialog extends RunBase
    {
        FormStringControl   SalesIdCtrl, ItemIdCtrl; 
    }

    2. Creation dialog.

    protected Object dialog(Dialog dialog, boolean forceOnClient)
    {
        DialogRunBase ret;
        ;
        ret = super(dialog, forceOnClient);
        ret.caption('Costing report by order');
    
        SalesIdCtrl = ret.formBuildDesign().addControl(FormControlType::String,'SalesId');
        SalesIdCtrl.extendedDataType(extendedTypeNum('SalesId'));
    
    
        ItemIdCtrl = ret.formBuildDesign().addControl(FormControlType::String,'ItemId');
        ItemIdCtrl.extendedDataType(extendedTypeNum('ItemId'));
    
    
        return ret;
    }

    3.Set the control can not override method at runtime.

    public void dialogPostRun(DialogRunbase dialog)
    {
        ;
        super(dialog);
        dialog.dialogForm().formRun().controlMethodOverload(true);
        dialog.dialogForm().formRun().controlMethodOverloadObject(this);
        SalesIdCtrl = dialog.dialogForm().formRun().design().controlName('SalesId');
        ItemIdCtrl = dialog.dialogForm().formRun().design().controlName('ItemId');
    }

    4.Creating lookup method.

    void ItemId_lookup()
    {
        Query                   query          = new Query();
        SysTableLookup          sysTableLookup =
        SysTableLookup::newParameters(tableNum(SalesLine), SalesIdCtrl);
        ;
        sysTableLookup.addLookupField(fieldNum(SalesLine, ItemId));
        sysTableLookup.addLookupField(fieldNum(SalesLine, Name));
        query.addDataSource(tableNum(SalesLine)).addRange(fieldNum(SalesLine,SalesId)).value(SalesIdCtrl.text());
        sysTableLookup.parmQuery(query);
        sysTableLookup.performFormLookup();
    }

    5.Detailed method other

    public container pack()
    {
        return conNull();
    }
    
    public boolean unpack(container packedClass)
    {
        return true;
    }
    
    static void main(Args _args)
    {
        LookupDialog test1 = new LookupDialog();
        ;
        if (test1.prompt())
        {
            test1.run();
        }
    }
  • 相关阅读:
    时间戳与时间之间的相互转化
    源代码管理之Git命令的使用
    ios最新设置状态栏字体颜色总结
    iOS 代码方式设置按钮标题、图片的偏移
    runloop简单介绍
    iOS中的多线程NSThread/GCD/NSOperation & NSOperationQueue
    AFNetworking的详细解析
    MATLAB相关快捷键以及常用函数
    CentOS 5.8下快速搭建FTP服务器
    php获取跳转后的真实链接
  • 原文地址:https://www.cnblogs.com/Fandyx/p/3200041.html
Copyright © 2011-2022 走看看