Fórumok
pop up showing just a Web Content
François LE QUEMENER, módosítva 14 év-val korábban
pop up showing just a Web Content
Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2009.09.18. Legújabb bejegyzések
Hi,
I'd like to show a pop up with a web content inside. It seems quite easy but I can't get it done :
It says :
Do you have any idea?
I'd like to show a pop up with a web content inside. It seems quite easy but I can't get it done :
<input type="button" value="RSS" onClick="var rssWindow = window.open('
<liferay-portlet:renderURL windowState=" <%="LiferayWindowState.POP_UP.toString()" %>" portletName="<%= PortletKeys.JOURNAL %>">
<portlet:param name="struts_action" value="/journal/view_article_content" /><portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="articleId" value="10761" />
',
'title',
'directories=no, height=640, location=no, menubar=no, resizable=yes,
scrollbars=yes, status=no, toolbar=no, width=680');
rssWindow.focus();" />
It says :
15:32:54,705 WARN [PortalImpl:2948] Current URL /web/guest/home?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview_article_content&_15_redirect=%2Fweb%2Fguest%2Fhome%3Fp_p_id%3D58%26p_p_lifecycle%3D1%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26saveLastPath%3D0%26_58_struts_action%3D%252Flogin%252Fcreate_account&_15_articleId=10761 generates exception: null
15:32:56,695 ERROR [PortletRequestProcessor:345] Forward does not exist
Do you have any idea?
Michael Poznecki, módosítva 14 év-val korábban
RE: pop up showing just a Web Content
Expert Bejegyzések: 301 Csatlakozás dátuma: 2008.12.10. Legújabb bejegyzések
Try setting your pop-up in a script and add the function to your button.
Button:
Then in your Javascript:
I'm not exactly sure about putting your liferay-portlet tags in there, but I use this for regular HTML.
Button:
<input type="button" value="Open" onClick="openWindow();" id="btnOpenWindow">
Then in your Javascript:
<script type="text/javascript">
function openWindow()
{
var html = "
<liferay-portlet:renderURL windowState="<%= LiferayWindowState.POP_UP.toString() %>" portletName="<%= PortletKeys.JOURNAL %>">
<portlet:param name="struts_action" value="/journal/view_article_content" /><portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="articleId" value="10761" />
</liferay-portlet:renderURL>"
popup = Liferay.Popup({
width: 680,
modal: true,
noDraggable: true,
noTitleBar: true,
message: html,
messageId: "title"});
</script>
I'm not exactly sure about putting your liferay-portlet tags in there, but I use this for regular HTML.
François LE QUEMENER, módosítva 14 év-val korábban
RE: pop up showing just a Web Content
Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2009.09.18. Legújabb bejegyzések
That's a good try but I renders the same result:
Here is your shot, that I corrected :
Result : the same but in a more beautiful way (in a js pop up) !
Here is your shot, that I corrected :
<script type="text/javascript">
function openWindow()
{
var html = "<liferay-portlet:renderURL windowState="<%= LiferayWindowState.POP_UP.toString() %>" portletName="<%= PortletKeys.JOURNAL %>">
<portlet:param name="struts_action" value="/journal/view_article_content" /><portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="articleId" value="10761" />
</liferay-portlet:renderURL>";
popup = Liferay.Popup({
width: 680,
modal: true,
noDraggable: true,
noTitleBar: true,
message: "",
messageId: "title"});
jQuery(popup).load(html);
}
</script>
<input type="button" value="Open" onClick="openWindow();" id="btnOpenWindow">
Result : the same but in a more beautiful way (in a js pop up) !
Romain Dequidt, módosítva 10 év-val korábban
RE: pop up showing just a Web Content
New Member Bejegyzések: 10 Csatlakozás dátuma: 2013.03.09. Legújabb bejegyzések
My webcontent adjustement source:
<p>Sample of webcontent with a link displaying a dialog containing anothe webcontent </p>
<p> </p>
<script type="text/javascript" charset="utf-8">
AUI().ready('aui-dialog','aui-dialog-iframe','liferay-portlet-url', function(A) {
var linkPopup = A.one('#popupLink');
linkPopup.on('click', function(event){
var url = Liferay.PortletURL.createRenderURL();
url.setPortletId("56"); // "Web Content Display" portlet ID
url.setWindowState('pop_up');
url.setParameter("_56_groupId", Liferay.ThemeDisplay.getScopeGroupIdOrLiveGroupId());
url.setParameter("_56_articleId", "10717"); // webcontent ID
window.myDialog = new A.Dialog(
{
title: 'Test d affichage d un webcontent dans une popup',
width: 640,
centered: true
}
).plug(
A.Plugin.DialogIframe,
{
uri: url.toString(),
iframeCssClass: 'dialog-iframe'
}
).render();
});
});
</script>
<p> </p>
<a href="#" id="popupLink">Popup link</a>
domu ansor harahap, módosítva 10 év-val korábban
RE: pop up showing just a Web Content
New Member Bejegyzés: 1 Csatlakozás dátuma: 2013.06.19. Legújabb bejegyzések
try this one,
create 1 jsp page eq, contentPopup.jsp, n load ur web content here
Then in your Javascript:
And button:
create 1 jsp page eq, contentPopup.jsp, n load ur web content here
<div>
<%
JournalArticle article = JournalArticleLocalServiceUtil.getLatestArticle(themeDisplay.getPortletGroupId(), 221640);
%>
<liferay-ui:journal-article articleId="<%= article.getArticleId() %>" articleResourcePrimKey="<%= article.getResourcePrimKey() %>" groupId="<%=themeDisplay.getScopeGroupId() %>" languageId="<%=themeDisplay.getLanguageId() %>" showAvailableLocales="<%=false %>" />
</div>
Then in your Javascript:
<portlet:renderURL var="contentPopupURL1" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="jspPage" value="/html/contentPopup.jsp"/>
<portlet:param name="redirect" value="<%= currentURL %>"/>
</portlet:renderURL>
<script type="text/javascript">
function showPopupContent() {
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
var dialog = new A.Dialog({
title: 'Process',
centered: true,
//xy: ['center', 200],
width: 943,
height: 298,
draggable: true,
modal: true
}).plug(A.Plugin.IO, {uri: '<%= contentPopupURL1 %>'}).render();
dialog.show();
});
}
</script>
And button:
<input type="button" value="Open" onClick="showPopupContent();" id="btnOpenWindow" />