You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kamalesh Kumar <ka...@ilumbini.com> on 2011/09/27 18:22:24 UTC

Need to open a popup from server side

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