为什么对话框中没有显示函数参数?

Why isn't the function parameter showing in the dialog?

作为字符串的函数参数未显示在对话框内容块中。我需要知道为什么以及如何进行这项工作。我要显示的参数是带有 php 代码的字符串。

我在我的函数中使用了 MessageToast.show() 来查看输出字符串。显示输出字符串。我也尝试过在内容块中添加 "hello world" 字符串,这很有效。

下面是我的代码逻辑是一个字符串

logicDialog: function (logic) {
            MessageToast.show(logic);
            var dialog = new Dialog({
                title: 'Boolean Logic',
                type: 'Message',
                content: new TextArea({
                    value: logic,
                    editable: false,
                    growing: true,
                    growingMaxLines: 20

                }),
                beginButton: new Button({
                    text: 'Close',
                    press: function () {
                        dialog.close();
                    }
                }),
                afterClose: function () {
                    dialog.destroy();
                }
            });
            dialog.open();
        }

预期结果是显示字符串逻辑的对话框。

由于@TiiJ7 的示例运行良好,我将尝试抛出一些可能的问题:

-is your Dialog a sap.m.Dialog()?;

-is there any error before the dialog is triggered? (that could somehow stop the functionality of the dialog);

-put a break point in the line of "dialog.close();" to check the content of the string on the scope of the dialog opened;

-is it possible that the string is being manipulated somewhere else and it could a be an issue with concurrency? 1 thread could be changing the value of the string (note that a string is a pointer).

我希望这些要点能给您带来启发,因为您是唯一可以访问整个代码的人。