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. ZBarSDK扫描二维码

    1:如果报引用文件错误的话需要在设置一下:project->Build settings->build active architecture only选项设置为No.Valid Arch ...

  2. android开发之路12(android四大组件&Fragment&AsyncTask类)

    一.Activity组件1.简介:Activity组件是Android四大组件之一,通常一个Activity相当于一个用户界面,我们可以通过加载布局文件将Android提供的各种控件及自定义控件显示到 ...

  3. 《MFC游戏开发》笔记九 游戏中的碰撞判定初步&怪物运动简单AI

    本系列文章由七十一雾央编写,转载请注明出处. http://blog.csdn.net/u011371356/article/details/9374935 作者:七十一雾央 新浪微博:http:// ...

  4. mysql优化方法

    1.选取最适用的字段属性 MySQL可以很好的支持大数据量的存取,但是一般说来,数据库中的表越小,在它上面执行的查询也就会越快.因此,在创建表的时候,为了获得更好的性能,我们可以将表中字段的宽度设得尽 ...

  5. 代码创建FlexibleSpaceBarButton(弹性空白)

    //1.创建toolbar左边的按钮,调用initWithTitle方法进行初始化 // UIBarButtonItem *extend = [[UIBarButtonItemalloc]initWi ...

  6. Sharepoint中有关文件夹的操作

    1.GetItemsWithUniquePermissions根据返回数量和是否返回文件夹获取唯一权限的列表项集合 对于SharePoint对象模型中SPList的GetItemsWithUnique ...

  7. CSS - 实现文字显示过长时用省略

    一.添加-文字显示超出范围时隐藏属性 overflow:hidden; 二.添加-超出文字省略号属性 text-overflow:ellipsis; 三.添加-文字不换行属性 white-space: ...

  8. 【ERROR】---Error executing "adb devices":ADB server didn't ACK

    搭建环境     ionic emulate android 的时候出现问题 端口占用,找到占用端口的程序,结束进程再启动 重新ionic emulate android 还是报错,闪了一下说fail ...

  9. JavaScript之放大镜效果2

    在放大图片效果的同时,我们怎么原图和放大窗体增加间隔呢? 我们只需应用一个table就行了: 源码上: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML ...

  10. OpenGl从零开始之坐标变换

    http://www.tuicool.com/articles/uiayYrI OpenGL学习脚印: 坐标变换过程(vertex transformation) http://blog.csdn.n ...