Foros de discusión

popup in generic portlet

thumbnail
Srikanth komma, modificado hace 12 años.

popup in generic portlet

Junior Member Mensajes: 33 Fecha de incorporación: 1/03/12 Mensajes recientes
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, modificado hace 12 años.

RE: popup in generic portlet

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
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, modificado hace 12 años.

RE: popup in generic portlet

Junior Member Mensajes: 33 Fecha de incorporación: 1/03/12 Mensajes recientes
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, modificado hace 12 años.

RE: popup in generic portlet

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
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, modificado hace 12 años.

RE: popup in generic portlet

Junior Member Mensajes: 33 Fecha de incorporación: 1/03/12 Mensajes recientes
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, modificado hace 12 años.

RE: popup in generic portlet

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
Thanks for sharing the solution !!!
Bella fernandis, modificado hace 11 años.

RE: popup in generic portlet

New Member Mensajes: 15 Fecha de incorporación: 6/11/12 Mensajes recientes
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.