留言板

popup in generic portlet

thumbnail
Srikanth komma,修改在12 年前。

popup in generic portlet

Junior Member 帖子: 33 加入日期: 12-3-1 最近的帖子
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
Mayur Patel,修改在12 年前。

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
Srikanth komma,修改在12 年前。

RE: popup in generic portlet

Junior Member 帖子: 33 加入日期: 12-3-1 最近的帖子
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
Mayur Patel,修改在12 年前。

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
Srikanth komma,修改在12 年前。

RE: popup in generic portlet

Junior Member 帖子: 33 加入日期: 12-3-1 最近的帖子
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
Mayur Patel,修改在12 年前。

RE: popup in generic portlet

Expert 帖子: 358 加入日期: 10-11-17 最近的帖子
Thanks for sharing the solution !!!
Bella fernandis,修改在11 年前。

RE: popup in generic portlet

New Member 帖子: 15 加入日期: 12-11-6 最近的帖子
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.