Fórum
popup in generic portlet
Srikanth komma, modificado 12 Anos atrás.
popup in generic portlet
Junior Member Postagens: 33 Data de Entrada: 01/03/12 Postagens Recentes
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....
Thanks in advance....
Mayur Patel, modificado 12 Anos atrás.
RE: popup in generic portlet
Expert Postagens: 358 Data de Entrada: 17/11/10 Postagens Recentes
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
This might help you,
Alloy Dialog Demo
Thanks
Srikanth komma, modificado 12 Anos atrás.
RE: popup in generic portlet
Junior Member Postagens: 33 Data de Entrada: 01/03/12 Postagens Recentes
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.
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.
Mayur Patel, modificado 12 Anos atrás.
RE: popup in generic portlet
Expert Postagens: 358 Data de Entrada: 17/11/10 Postagens Recentes
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
See this,
Popup in Liferay
Srikanth komma, modificado 12 Anos atrás.
RE: popup in generic portlet
Junior Member Postagens: 33 Data de Entrada: 01/03/12 Postagens RecentesSrikanth 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);
}
}
Mayur Patel, modificado 12 Anos atrás.
RE: popup in generic portlet
Expert Postagens: 358 Data de Entrada: 17/11/10 Postagens Recentes
Thanks for sharing the solution !!!
Bella fernandis, modificado 11 Anos atrás.
RE: popup in generic portlet
New Member Postagens: 15 Data de Entrada: 06/11/12 Postagens RecentesSrikanth 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.