我已经使用向导在 AX 2012 中创建了一个向导...现在我需要添加 1 个功能,即根据用户输入启用或禁用 FINISH 按钮。
我已经尝试过这3种方法,但都没有成功..
this.finishenabled() -- 关于向导类的 SetupNavigation 方法
finishenabled[formrun.tabidx()] = false -- 在向导类的 SetupNavigation 方法上
syswizard.finishenable(false, curtabidx(),false) - 在向导表单的标签页上
如果有人对此有解决方案,请回复....
最佳答案
Wizard 类有一个验证方法,您将在其中执行以下操作:
boolean validate()
{
if(SomeTestCondition)
{
return true;
}
return false;
}
根据 Microsoft 的说法,此方法执行以下操作:
Used to validate user input, and called before the wizard is closed. It returns false if user input is invalid. This will prevent the run method from being called when the user clicks the Finish button. Wizard Class on MSDN
此外,您可以在要验证的字段上使用 textchanged() 方法(或者如果不是文本,则可以使用对象的 changed 方法)。
if (this.text())
{
if (!sysWizard.isNextEnabled())
{
sysWizard.nextEnabled(true, sysWizard.curTab(), false);
}
}
else
{
if (sysWizard.isNextEnabled())
sysWizard.nextEnabled(false, sysWizard.curTab(), false);
}
同样来自 MSDN Enable Buttons
关于axapta - 根据用户输入启用/禁用向导的 FINISH 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16557569/