掲示板

popup in generic portlet

thumbnail
12年前 に Srikanth komma によって更新されました。

popup in generic portlet

Junior Member 投稿: 33 参加年月日: 12/03/01 最新の投稿
I have a requirement that i have to open a popup to from my portlet ,i am using Liferay6.0.5 and my portlet is generic portlet.If i use the technic of using liferay popup its not working that means i am not getting the liferay portla API support in the popup.if i use renderURL that is also not working.Any Idea will be appreciated.

Thanks in advance....
thumbnail
12年前 に Mayur Patel によって更新されました。

RE: popup in generic portlet

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
you can make use of Alloy Dialog instead of Lifeary Popup and It will solve your issue.

This might help you,
Alloy Dialog Demo
Thanks
thumbnail
12年前 に Srikanth komma によって更新されました。

RE: popup in generic portlet

Junior Member 投稿: 33 参加年月日: 12/03/01 最新の投稿
Hi Mayur,
Thanks for your time I think AlloyUI is suitable for show something with the existing data on the page but i want to construct portletURL and display the list of records using liferay search container.
thumbnail
12年前 に Mayur Patel によって更新されました。

RE: popup in generic portlet

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
I think if you generate Portal render URL and display that jsp that is constructed with list of records using search container, those data will be shown in popup

See this,
Popup in Liferay
thumbnail
12年前 に Srikanth komma によって更新されました。

RE: popup in generic portlet

Junior Member 投稿: 33 参加年月日: 12/03/01 最新の投稿
Srikanth komma:
I have a requirement that i have to open a popup to from my portlet ,i am using Liferay6.0.5 and my portlet is generic portlet.If i use the technic of using liferay popup its not working that means i am not getting the liferay portla API support in the popup.if i use renderURL that is also not working.Any Idea will be appreciated.

Thanks in advance....

I got the solution as given below.
URL Construciton

<portlet:renderURL var="popUpURL" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="viewJsp" value="/selectDefaultContext.jsp"/>
<portlet:param name="redirect" value="<%= redirect %>"/>
</portlet:renderURL>

<a href="#" onClick="javascript:showPopup('<%= popUpURL %>')" ><liferay-ui:message key="change" /></a></span>
Script
<script type="text/javascript">
function showPopup(url) {
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
var dialog = new A.Dialog({
title: '<liferay-ui:message key="select-default-organization" />',
height:350,
width:500,
centered: true,
draggable: true,
modal: true
}).plug(A.Plugin.IO, {uri: url}).render();
dialog.show();
});
}
</script>

Override the path value in include method of action class

protected void include(String path, RenderRequest renderRequest,
RenderResponse renderResponse) throws IOException, PortletException {

if (renderRequest.getParameter("viewJsp") != null) {
path = renderRequest.getParameter("viewJsp");
}

PortletRequestDispatcher portletRequestDispatcher = getPortletContext()
.getRequestDispatcher(path);
if (portletRequestDispatcher == null) {
log_.error(path + " is not a valid include");
} else {
portletRequestDispatcher.include(renderRequest, renderResponse);
}
}
thumbnail
12年前 に Mayur Patel によって更新されました。

RE: popup in generic portlet

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
Thanks for sharing the solution !!!
11年前 に Bella fernandis によって更新されました。

RE: popup in generic portlet

New Member 投稿: 15 参加年月日: 12/11/06 最新の投稿
Srikanth komma:
Srikanth komma:
I have a requirement that i have to open a popup to from my portlet ,i am using Liferay6.0.5 and my portlet is generic portlet.If i use the technic of using liferay popup its not working that means i am not getting the liferay portla API support in the popup.if i use renderURL that is also not working.Any Idea will be appreciated.

Thanks in advance....

I got the solution as given below.
URL Construciton

<portlet:renderURL var="popUpURL" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="viewJsp" value="/selectDefaultContext.jsp"/>
<portlet:param name="redirect" value="<%= redirect %>"/>
</portlet:renderURL>

<a href="#" onClick="javascript:showPopup('<%= popUpURL %>')" ><liferay-ui:message key="change" /></a></span>
Script
<script type="text/javascript">
function showPopup(url) {
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
var dialog = new A.Dialog({
title: '<liferay-ui:message key="select-default-organization" />',
height:350,
width:500,
centered: true,
draggable: true,
modal: true
}).plug(A.Plugin.IO, {uri: url}).render();
dialog.show();
});
}
</script>
Override the path value in include method of action class

protected void include(String path, RenderRequest renderRequest,
RenderResponse renderResponse) throws IOException, PortletException {

if (renderRequest.getParameter("viewJsp") != null) {
path = renderRequest.getParameter("viewJsp");
}

PortletRequestDispatcher portletRequestDispatcher = getPortletContext()
.getRequestDispatcher(path);
if (portletRequestDispatcher == null) {
log_.error(path + " is not a valid include");
} else {
portletRequestDispatcher.include(renderRequest, renderResponse);
}
}


Hey Srikanth komma, can you please guide me about your last step(Override the path value in include method of action class. I am a newbiee in liferay so not able to understand the concept of overriding the path.
Your any help will be appreciated.