开发者

How to open new popup window from liferay portal using jsp?

How to open new popup window from portal using java script.

I have jsp page with button , if i click the button need to open new popup window from portal.

onClick="window.open('/html/viewpdf.jsp','mywi开发者_如何学JAVAndow','width=500,height=350,toolbar=no,resizable=yes')">

this doesn't working jsp page.


Try this:

  onClick="
var organizationWindow = window.open('<portlet:renderURL windowState="<%= LiferayWindowState.POP_UP.toString() %>"><portlet:param name="jspPage" value="/html/viewpdf.jsp"/><portlet:param name="redirect" value="#"/></portlet:renderURL>',
         'title',
        'directories=no, height=340, location=no, menubar=no, resizable=yes,scrollbars=yes, status=no, toolbar=no, width=680');
        organizationWindow.focus();"


you can create an icon <liferay-ui:icon image="add" message="Add a Person to this group" url="javascript:alertAdd();" />

then add the script that this icon calls to open the popup

<aui:script use="aui-dialog,aui-overlay-manager">
   Liferay.provide(
    window,
    'alertAdd',
    function() {
        var instance = this;
        var url='${details}';

            Liferay.Util.openWindow(
                {
                    cache: false,
                    dialog: {
                        align: Liferay.Util.Window.ALIGN_CENTER,
                        after: {
                            render: function(event) {
                                this.set('y', this.get('y') + 50);
                            }
                        },
                        width: 820
                    },
                    dialogIframe: {
                        id: 'addIFrame',
                        uri: url
                    },
                    title: Liferay.Language.get('cloud'),
                    uri: url
                }
            );
    },
    ['liferay-util-window']
);

NOTE that you will need the URL ${details}

<portlet:renderURL var="details">
<portlet:param name="mvcPath" value="/html/grouping/member_search_popup.jsp"/></portlet:renderURL>


Yes , this opening popup window.But in liferay portal just opening http://localhost:8080/web/guest only. not opening the viewpdf.jsp.

my requirment is print the datatable values from the page.So datatable have scrollbar, though doesn't print page not correct.

So that i planned to display the datatable values in the popup window and there print button, it should display the all data.

function callsubmit(){
    
  window.print();
  window.opener.document.location = window.opener.document.location.href;
  window.close();
  
}

I would like know how to print datatable all values to print.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜