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();
}
}

How to achieve dialog with lookup control的更多相关文章

  1. wx.Dialog

    wx.Dialog A dialog box is a window with a title bar and sometimes a system menu, which can be moved ...

  2. [转]Angular 4|5 Material Dialog with Example

    本文转自:https://www.techiediaries.com/angular-material-dialogs/ In this tutorial, we're going to learn ...

  3. A Complete ActiveX Web Control Tutorial

    A Complete ActiveX Web Control Tutorial From: https://www.codeproject.com/Articles/14533/A-Complete- ...

  4. wx

    wx The classes in this module are the most commonly used classes for wxPython, which is why they hav ...

  5. windows消息机制详解(转载)

    消息,就是指Windows发出的一个通知,告诉应用程序某个事情发生了.例如,单击鼠标.改变窗口尺寸.按下键盘上的一个键都会使Windows发送一个消息给应用程序.消息本身是作为一个记录传递给应用程序的 ...

  6. Essential controls for web app

    AUTO-COMPLETE/AUTO-SUGGEST Auto-complete using Vaadin Offer auto-suggest or auto-complete to help yo ...

  7. win7的优化-1:隐藏我的电脑导航栏里的收藏等项目

    1. Type regedit in RUN or Start Menu search box and press Enter. It'll open Registry Editor. 2. Now ...

  8. devexpress13学习系列(一)PDFViewer(2)

    DevExpress.XtraPdfViewer Namespace 该命名空间下,保留着pdfviewer组件需要的类,主要有:   Class Description   PdfCurrentPa ...

  9. Service Oriented Architecture

    What is Service Oriented Architecture (SOA)? There have been so many interpretations of this through ...

随机推荐

  1. iOS -动态可变参数

    #import "ViewController.h" @interface ViewController () @end @implementation ViewControlle ...

  2. 【开源项目12】Retrofit – Java(Android) 的REST 接口封装类库

    Retrofit官网:http://square.github.io/retrofit/ Retrofit 和Java领域的ORM概念类似, ORM把结构化数据转换为Java对象,而Retrofit ...

  3. 《Cortex-M0权威指南》之体系结构---存储器系统

    转载请注明来源:cuixiaolei的技术博客 Cortex-M0处理器为32位处理器,所以具有最大4G的寻址空间.在体系结构上,存储器空间被划分位一系列的区域,每个区域都有推荐的用途,以提高不同设备 ...

  4. 怒刷DP之 HDU 1160

    FatMouse's Speed Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Su ...

  5. 1027 姓名与ID[二分图匹配(匈牙利)]

    1027 姓名与ID  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 大师 Master 题解  查看运行结果       题目描述 Description 有N个人,各自有一 ...

  6. Python(2.7.6) 标准日志模块的简单示例

    Python 标准库中的 logging 模块提供了一套标准的 API 来处理日志信息的打印. import logging logging.basicConfig( level = logging. ...

  7. PHP利用GD库画曲线

    效果: PHP代码 <?php Header('Content-type: image/png;Charset:utf-8'); //声明图片 $im = imagecreate(400,200 ...

  8. 干货:Android 源码使用心得分享

          我相信很多初学者会和我一样经常在网上去找Android开发源码,但是往往因为运行不起来非常的懊恼!在做爱开发网站的时候,收集App代码时就遇到了这种困难,我相信网络上面的源码大部分在发布前 ...

  9. Joson的简单用法

    Josn实体类如下: public class Result { public int StatusCode { get; set; } public string Message { get; se ...

  10. 入门必须掌握8个DOS命令

    一,ping 它是用来检查网络是否通畅或者网络连接速度的命令.作为一个生活在网络上的管理员或者黑客来说,ping命令是第一个必须掌握的DOS命令,它所利用的原理是这样的:网络上的机器都有唯一确定的IP ...