代码之家  ›  专栏  ›  技术社区  ›  Nicolas Raoul

Liferay.Util。用帖子URL打开窗口?(以允许更长的参数)

  •  0
  • Nicolas Raoul  · 技术社区  · 7 年前

    该portlet转换文本并将结果发送回弹出窗口中显示 ):

    <liferay-portlet:renderURL
            portletName="<%= portletId %>"
            var="uri"
            windowState="<%=LiferayWindowState.POP_UP.toString()%>">
        <portlet:param name="text" value="TEXTPLACEHOLDER" />
    </liferay-portlet:renderURL>
    
    <aui:script>
    function transformTextAndShowPopup() {
        var uri = "<%= uri %>";
        uri = uri.replace("TEXTPLACEHOLDER", readTextEnteredByUser());
    
        javascript:Liferay.Util.openWindow({
            dialog:{
                width: 700,
                height: 300,
                resizable: true,
                modal:false,
                destroyOnClose: true
            },
            id: "My popup",
            title: "My popup",
            uri: uri
        });
    </aui:script>
    

    :我现在也需要处理长文本。我不能再依赖GET参数了,因为 GET parameters can not be over a few kilobytes

    The server refused this request because the request URI was too long.
    

    问题:我可以启动一个 Liferay.Util.openWindow 有POST请求吗?或者打开带有长文本的Liferay弹出窗口?(如30KB)

    1 回复  |  直到 7 年前
        1
  •  1
  •   Reigo    7 年前

    我的建议是显示带有加载图标的对话框作为内容。 然后通过Ajax post查询将文本发布到actionURL(使用A.io.request或jQuery),完成后,只需用Ajax查询的结果替换对话框窗口主体的内容。