我使用合金对话框显示弹出的数据。
搜索容器内部
这里viewDocs按钮的id将被覆盖到viewDocs,无论viewDocs.jsp中给出的id是什么
<portlet:renderURL var="docListView"
windowState="<%=LiferayWindowState.POP_UP.toString()%>">
<portlet:param name="mvcPath"
value="/html/emp/docList.jsp"/>
<portlet:param name="redirect" value="<%= currentURL %>"/>
<portlet:param name="prk" value="<%= prk %>"/>
</portlet:renderURL>
<aui:button name="viewDocs" id="view_<%=prk %>" cssClass="btn btn-primary btn-small" value="View Docs" onclick="viewDetails()"></aui:button>
<aui:script>
function viewDetails()
{
AUI().use('aui-base','aui-io-plugin-deprecated','liferay-util-window',
'aui-dialog-iframe-deprecated',
function(A) {
var popUpWindow=Liferay.Util.Window.getWindow(
{
dialog: {
destroyOnClose:true,
centered: true,
constrain2view: true,
modal: true,
resizable: false,
height:300,
width: 700
}
}
).plug(
A.Plugin.DialogIframe,
{
autoLoad: true,
iframeCssClass: 'dialog-iframe',
uri:'<%=docListView.toString()%>'
}).render();
popUpWindow.show();
popUpWindow.titleNode.html("Document List");
popUpWindow.io.start();
});
}
在docList.jsp中 long proposalPrk = Long.parseLong((String)request.getParameter(“prk”));
//It retrives the same value of primary key on every button click
如果我在会话中设置主键的值如何在弹出窗口结束时删除该会话属性?
答案 0 :(得分:0)
您可以在弹出窗口关闭时触发Ajax调用,并在serveResource方法中从会话中删除该属性。
@Override
public void serveResource(ResourceRequest resourceRequest,
ResourceResponse resourceResponse) throws IOException,
PortletException {
resourceRequest.getPortletSession().removeAttribute(arg0)
super.serveResource(resourceRequest, resourceResponse);
}