过滤器在对话框中查找 [英] filter look up in dialog

查看:176
本文介绍了过滤器在对话框中查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在类中创建了一个对话框,对话框方法如下

  static void dialog(Args _args)
{
对话框对话框;
DialogField dialogFieldCurrentState;
DialogField dialogFieldNewState;
CustInvoiceTable custInvoiceTable;


;

custInvoiceTable = _args.record();



dialog = new Dialog(Change State);
dialogFieldCurrentState = dialog.addField(TypeID(State_LT),Current State:);
dialogFieldCurrentState.value(custInvoiceTable.State);
dialogFieldCurrentState.enabled(false);
dialogFieldNewState = dialog.addField(TypeID(State_LT),New State:);

if(dialog.run())
{
custInvoiceTable.State = dialogFieldNewState.value();

}

}

有两个文件当前状态新状态。现在当我选择新状态所有
状态的列表显示(不论国家),我不想要。在查找
中,只有国家各自的状态必须显示
。我需要使用像过滤器这样的过滤器。 ,同时选择AddressState
其中addressState.CountryRegionId == custInvoiceTable.CountryRegionId;
,以便只显示
与一个国家相关的状态。 / p>

State_LT这里是一个字符串EDT(我放在State_LT的关系中)State_LT == AddressState.StateId



IN AdressState有一个方法lookupStateId(),如何从一个对话框(上面的代码)调用它

解决方案

p>我正在回答你的最后一个问题:在地址有一个方法lookupStateId(),如何从对话框(代码上面)调用它? - 以大写字母写的方式不能帮助人们更好地理解你的观点。



目前还不清楚为什么你的对话框是一个静态方法,无论如何,您需要以下内容。



假设您的ClassDeclaration如下所示:

  class TestClass1扩展RunBase 
{
对话框对话框;
DialogField dialogFieldCurrentState;
DialogField dialogFieldNewState;
// etcetera
}

您的对话框是这样的:

  public Object dialog()
{
;

dialog = super();

dialogFieldCurrentState = dialog.addField(TypeID(AddressStateId),Current State:);
dialogFieldCurrentState.enabled(false);
dialogFieldNewState = dialog.addField(TypeID(AddressStateId),New State:);
dialogFieldNewState.lookupButton(FormLookupButton :: Always); //如果需要

返回对话框;
}

要按照你想要的方式实现查找,你需要做两件事情。首先,打开对话框,右键单击新建状态,单击安装,然后检查控件的系统名称。例如,如果 Fld2_1 ,则需要创建以下方法:

  void fld2_1_lookup() 
{
Object control = dialog.formRun()。controlCallingMethod();
;

AddressState :: lookupStateId(控件,dialogFieldNewState.value());
}

其次,有必要覆盖以下方法:

  public void dialogPostRun(DialogRunbase _dialog)
{
super(_dialog);

_dialog.dialogForm()。formRun()。controlMethodOverload(true);
_dialog.dialogForm()。formRun()。controlMethodOverloadObject(this);
}

这应该是诀窍。我没有做过一段时间,但我不认为我忘了一些东西。


I Have created a dialog in a class, the dialog method is as below

static void dialog(Args _args)
{
Dialog              dialog;
DialogField         dialogFieldCurrentState;
DialogField         dialogFieldNewState;
CustInvoiceTable    custInvoiceTable;


;

custInvoiceTable = _args.record();



dialog                  = new Dialog("Change State");
dialogFieldCurrentState = dialog.addField(TypeID(State_LT),"Current State: ");
dialogFieldCurrentState.value(custInvoiceTable.State);
dialogFieldCurrentState.enabled(false);
dialogFieldNewState     = dialog.addField(TypeID(State_LT),"New State: ");

if (dialog.run())
{
    custInvoiceTable.State =  dialogFieldNewState.value();

}

}

in my dialog there are two fileds Current State and New State .Now when i select the New State the list of all states is displayed(irrespective of country) which i dont want. Only the states respective of country has to be shown in the lookup . I need to make use of a filter something like e.g. while select while select AddressState where addressState.CountryRegionId == custInvoiceTable.CountryRegionId; so that only states which are related to a country is shown.

State_LT here is an string EDT (where i put in the relation of State_LT) State_LT == AddressState.StateId

IN AdressState there is a method lookupStateId(), How to call it from a dialog(code above) ?

解决方案

I am answering to your last question: "IN AdressState THERE IS A METHOD lookupStateId(), HOW TO CALL IT FROM A DIALOG(code above) ?" - by the way writing in capital letters doesn't help people understand your point better.

It is not clear why your dialog is a static method, anyway you'd need the following.

Let's say your ClassDeclaration looks something like this:

class TestClass1 extends RunBase
{
    Dialog      dialog;
    DialogField dialogFieldCurrentState;
    DialogField dialogFieldNewState;
    // etcetera
}

Your dialog is something like this:

public Object dialog()
{
    ;

    dialog = super();

    dialogFieldCurrentState = dialog.addField(TypeID(AddressStateId),"Current State: ");
    dialogFieldCurrentState.enabled(false);
    dialogFieldNewState     = dialog.addField(TypeID(AddressStateId),"New State: ");
    dialogFieldNewState.lookupButton(FormLookupButton::Always);     // If needed

    return dialog;
}

To implement a lookup the way you want it you need to do two things. First, open the dialog, right click on the New State, click Setup, and check the control's System Name. If for example it is Fld2_1 then you need to create the following method:

void fld2_1_lookup()
{
    Object control = dialog.formRun().controlCallingMethod();
    ;

    AddressState::lookupStateId(control, dialogFieldNewState.value());
}

Second, it is necessary to override the following method:

public void dialogPostRun(DialogRunbase _dialog)
{
    super(_dialog);

    _dialog.dialogForm().formRun().controlMethodOverload(true);
    _dialog.dialogForm().formRun().controlMethodOverloadObject(this);
}

That should do the trick. I haven't done it for a while but I don't think I forgot something.

这篇关于过滤器在对话框中查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆