一种弹出方法,该方法创建一个新的弹出窗口,而不是替换旧的弹出窗口

时间:2018-11-02 16:05:13

标签: javascript java

这是我到目前为止的Java逻辑。

public String loadAccountData(){
    // View's id in the same form as used in the navigation rules in
    // faces-config.xml
    // This value couldbe passed as parameter (using <f:param>)
    String selectedSSN;
    String selectedPhone;
    fraudSelectionList=new ArrayList<FraudCustomerReqtUIModelBean>();
    if(selectedSSNCommandLink!=null || selectedPhoneCommandLink!=null || fraudCustomerReqtUIModelBean.getSSN()!=null || fraudCustomerReqtUIModelBean.getPhone()!=null){
         selectedSSN = selectedSSNCommandLink;
         selectedPhone = selectedPhoneCommandLink;
         if(selectedSSN !=null || selectedPhone !=null){
                fraudCustomerReqtUIModelBean = new FraudCustomerReqtUIModelBean();
                fraudCustomerReqtUIModelBean.setSSN(selectedSSN);
                fraudCustomerReqtUIModelBean.setPhone(selectedPhone);
                fraudSelectionList.add(fraudCustomerReqtUIModelBean);
            }
    }

    final String viewId = "/pages/recovery/fraud/displayFraudPhoneSearchDetails.jspx";

    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application application = facesContext.getApplication();

        ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
        String actionUrl = viewHandler.getActionURL(facesContext,
                viewId);

        if(fraudSelectionList !=null && fraudSelectionList.size() >0 ){

            String javaScriptText = "window.open('" + actionUrl
                + "', 'popupWindow', 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=no,resizable=yes,screenX=0,screenY=0,left=0,top=0,width=(screen.availWidth - 10).toString(),height=(screen.availHeight - 122).toString()');";

        AddResource addResource = AddResourceFactory.getInstance(facesContext);

        addResource.addInlineScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javaScriptText);

        return javaScriptText;
        }
        else{

        return "fraudSearch";

        }
    }

在这里称为代码-

    <tr:commandLink text="#{fraudSearch.IBSAccountData1.SSN}" action="#{fraudSearch.loadAccountData}">
                                                                                <tr:setActionListener from="#{fraudSearch.IBSAccountData1.SSN}" to="#{fraudSearch.selectedSSNCommandLink}" />
                                                                                </tr:commandLink>

现在,它将生成弹出窗口,但是如果我想在已经存在一个弹出窗口时又生成另一个弹出窗口,它将简单地再次填充旧的弹出窗口。如何使它完全填充完全不同的弹出窗口,以及如何将一次打开的弹出窗口的数量限制为上限。

0 个答案:

没有答案