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. 源自梦想 eclipse快捷键整理

        Ctrl+1 快速修复(最经典的快捷键,就不用多说了) Ctrl+D: 删除当前行  Ctrl+Alt+↓ 复制当前行到下一行(复制增加) Ctrl+Alt+↑ 复制当前行到上一行(复制增加) ...

  2. 构建项目AppFuse+QuickStart

    AppFuse是一个完整的框架来构建web应用程序.它最初是为了构建新的web应用程序少走弯路.多年来,它已成为一个非常成熟的可测试和创建基于java的web应用安全系统.在其核心,AppFuse是项 ...

  3. Mindjet MindManager 2016/2017 折腾记录

    https://community.mindjet.com/mindjet/topics/ensure-2017-64-bit-version-installation Mindmanager sho ...

  4. codechef January Challenge 2014 Sereja and Graph

    题目链接:http://www.codechef.com/JAN14/problems/SEAGRP [题意] 给n个点,m条边的无向图,判断是否有一种删边方案使得每个点的度恰好为1. [分析] 从结 ...

  5. 实现toolbar透明的背景效果

    //MyToolbar.h 头文件 @interface MyToolbar : UIToolbar @end //MyToolbar.m 实现文件 #import "MyToolbar.h ...

  6. Asp.net的内置对象!!!

    还记得自己第一次面试的时候,面试官问的问题就是.net内置对象的问题,当时就让尴尬的要死... 所以作为新手的我们还是要知道这些轮廓的东西的! 1.Response对象 2.Request对象 3.A ...

  7. Table of Contents - 设计模式

    设计原则 OCP - 开闭原则 SRP - 单一职责原则 DIP - 依赖倒置原则 ISP - 接口隔离原则 LSP - 里氏替换原则 LoD - 迪米特法则 创建型模式 工厂方法模式 抽象工厂模式 ...

  8. 【CSS3】---结构性伪类选择器-first-child+last-child

    结构性伪类选择器—first-child “:first-child”选择器表示的是选择父元素的第一个子元素的元素E.简单点理解就是选择元素中的第一个子元素,记住是子元素,而不是后代元素. 示例演示 ...

  9. 二维码zxing源码分析(二)decode部分

           在上一篇博客中分析了zxing怎么打开摄像头,并且扫描结果,那么扫描之后的数据呢,是不是就要解析了呢,那我们看一下zxing怎么解析这个数据的.       上一篇博客地址ZXING源码 ...

  10. DWZ (JUI) 教程 tree 控件的选中事件

    DWZ (JUI) 教程 tree 控件的选中事件 先简单说一下流程 第一步 当然是先定义好回调事件了 function checkCallback(json){ ........... ...... ...