为什么不在第二次打开AlloyUI模态对话框?

问题描述 投票:0回答:1

我正在尝试将外部URL加载到Liferay Portal中的模态AlloyUI对话框中。如果我在第一次打开对话框时显示内容,但第二次没有显示内容。如果刷新它显示的页面。

这是我的功能:

Liferay.provide(
    window,
    'openModal',
    function(title, url) {
        var A = AUI();
        var width = 800;

        var modal = Liferay.Util.Window.getWindow({
            dialog: {
                centered: true,
                constrain2view: true,
                modal: true,
                resizable: false,
                height: 650,
                width: width,
                //destroyOnClose: true,
                destroyOnHide: true,
                toolbars: {
                    footer: [
                        {
                            label: 'Close',
                            cssClass: 'btn-link pull-right',
                            on: {
                                click: function() {
                                    modal.hide();
                                }
                            }
                        }
                    ]
                }
            },
            closeOnOutsideClick: true,
            id:'test-dialog',
            title: title
        }).plug(A.Plugin.IO, {
            uri: url,
            on: {
                success: function(event) {
                    console.log("success");
                },
                complete: function(event) {
                    console.log("complete");
                },
                start: function(event) {
                    console.log("start");
                },
                failure: function(event) {
                    console.log("failure");
                }
            }
        }).render();
    }
);

该功能在此链接中使用:

<a href="javascript:openModal('${title}','${url}');">Open dialog</a>

当我第二次打开对话框时出现此错误:

无法读取未定义的属性“Window”

liferay yui liferay-aui alloy-ui
1个回答
0
投票

通过使用qazxsw poi模块而不是qazxsw poi解决

© www.soinside.com 2019 - 2024. All rights reserved.