myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamalesh Kumar <kamalesh.ku...@ilumbini.com>
Subject Need to open a popup from server side
Date Tue, 27 Sep 2011 16:22:24 GMT
Hi ,

I want to call a javascript function to open a popup from server side.
I have a commandLink on which an actionListener  is specified . The code 
is as below:

    ExternalContext eCon = 
FacesContext.getCurrentInstance().getExternalContext();
        HttpServletRequest request = (HttpServletRequest) 
eCon.getRequest();
        selWkshtCol = request.getParameter("selectedWkshtCol");

        FacesContext facesContext = FacesContext.getCurrentInstance();
        String actionUrl = "validation.jsf";
        String javaScriptText = "window.open('"+actionUrl+"', 
'popupWindow', 'dependent=yes, menubar=no, toolbar=no');";

        AddResource addResource = 
AddResourceFactory.getInstance(facesContext);
        addResource.addInlineScriptAtPosition(facesContext, 
AddResource.HEADER_BEGIN, javaScriptText);


This  is not opening the popup.
Please suggest.

Regards
Kamalesh





Mime
View raw message