留言板

Closing a liferay popup on click of a button

thumbnail
Aditya Rao,修改在11 年前。

Closing a liferay popup on click of a button

Junior Member 帖子: 86 加入日期: 12-2-20 最近的帖子
I want to close my popup on button click.
something like:
<aui:button type="button" value="close" onclick=""/>
Anybody pls help me out on this.
Thanks.
thumbnail
Aditya Rao,修改在11 年前。

RE: Closing a liferay popup on click of a button

Junior Member 帖子: 86 加入日期: 12-2-20 最近的帖子
Is there nobody who can help me out on this??
thumbnail
Aditya Rao,修改在11 年前。

RE: Closing a liferay popup on click of a button (答复)

Junior Member 帖子: 86 加入日期: 12-2-20 最近的帖子
After a long time i came across to the solution of this problem..

First write a function in the aui:script -

<aui:script >
AUI().ready('aui-dialog', function(A) {
A.get('#hideAll').on('click', function() {
A.DialogManager.hideAll();
});
});
</aui:script>


Then inside the form add a button like-

<aui:button type="button" value="close" id="hideAll"/>

Using this in the pop-up window we can close the pop-up by clicking the close button..
interesting facts,修改在11 年前。

RE: Closing a liferay popup on click of a button

Junior Member 帖子: 53 加入日期: 12-5-18 最近的帖子
Hi thanks worked for me too
thumbnail
Aditya Rao,修改在11 年前。

RE: Closing a liferay popup on click of a button

Junior Member 帖子: 86 加入日期: 12-2-20 最近的帖子
Gud. emoticon
thumbnail
Atin Agarwal,修改在10 年前。

RE: Closing a liferay popup on click of a button

Junior Member 帖子: 86 加入日期: 12-2-20 最近的帖子
Above solution some how doesn't work with Liferay 6.1 GA2.
Got another solution -

<aui:button type="button" value="close" onClick="javascript:closePopUp();"/>

<aui:script>
function closePopUp() {
top.document.getElementById('closethick').click();
}
</aui:script>

Where, 'closethick' is the id of the red cross button on the top-right of the pop-up.