AX2012 使用HTML自定义popup内样式

 

在Class Box下新增方法如下:

public client static DialogButton yesNoHTML(
    str                 _text,
    DialogButton        _defaultButton,
    str                 _title = "@SYS11132",
    boolean             _modal = false)
{
    Args                args;
    Object              formRunObj;
    FormRun             formRun;
    ;

    args = new Args();
    args.name(formstr(SysBoxForm));

    formRun = classfactory.formRunClass(args);
    formRun.init();

    formRunObj = formRun;
    formRunObj.setTitle(_title);
    formRunObj.setText(_text, false);
    formRunObj.setType(DialogBoxType::YesNoBox);
    formRunObj.parmDefaultButton(_defaultButton);

    formRun.run();
    formRun.wait(_modal);

    return formRunObj.dialogButton();
}

2. 调用

popupMess = strFmt('<span style="color:red;"><b>加粗红色高亮显示:%1</b></span>', popupMess);
if(Box::yesNoHTML(popupMess, DialogButton::No) == DialogButton::No)
    return;

 

posted @ 2022-01-06 10:19  一口一个小馒头  阅读(112)  评论(0编辑  收藏  举报