How to rename dialog box buttons or create new in Ax 2012?

谁说我不能喝 提交于 2020-01-04 12:49:10

问题


Is it possible to rename dialog box buttons?
For example on "okCancel" can I rename the "ok" button as "continue"?

If not please guide me how can I create my own dialog box?

Thanks ahead.


回答1:


A button has a "Text" property. You can set that property or do so by code:

okButton.text("Continue");

The Box::okCancel uses the DialogBox class which is a kernel class and cannot be changed. The yesNoAxaptaForm method on the other hand uses an AX form, so you can roll on your own. That said it seems to gain little value.

Also consider using the RunBase framework with a form, as demonstrated in the Tutorial_RunbaseForm class.




回答2:


You can create a new method in class Dialog overwriting the control #okButton and call this method in your new dialog. When Dialog class is create in the method new call the method initButtons, which can be overridden.

For example:

FormBuildButtonGroupControl     buttonGroup;
formBuildCommandButtonControl   okButton;
;
buttonGroup = dialogForm.buildDesign().control(#bottomGroup);
if (buttonGroup)
{
    okButton = dialogForm.buildDesign().control(#okButton);
    okButton.text("test");
}


来源:https://stackoverflow.com/questions/23405946/how-to-rename-dialog-box-buttons-or-create-new-in-ax-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!