我想通过在JSF中点击<p:commandButton>
按钮来打开一个新的弹出窗口。
下面是我的代码:
<h:inputText style="width:42%"value="#{xxbean.values}" rendered="#{xxBean.yy == true}"
onblur="cc;" maxlength="6">
</h:inputText>
<p:commandButton value="FindPhone" id="xxne" actionListener="#{xx.findPhoneSearch}"
oncomplete="window.open('#{xx.wpUrl}', '_blank')"
rendered="#{xx.editCmdActionflg == true }" async="false">
<f:param name="pmid" value="#{xx.Details.uid}"/>
</p:commandButton>
我正在调用findPhoneSearch方法,就像上面在命令按钮的actionlistener中给出的那样。
这是findPhoneSearch方法:
public void FindphoneSearch(ActionEvent event) {
String param = "";
Map<String, String> params = FacesContext.getCurrentInstance()
.getExternalContext().getRequestParameterMap();
String expression = "^[a-z0-9]+$";
Pattern pattern = Pattern.compile(expression);
if (params.get("pmid") != null) {
String t_pmid = params.get("pmid");
Matcher matcher = pattern.matcher(t_pmid);
if (matcher.matches()) {
param = "/cgi-bin/Findphones.pl?id=" + t_pmid.trim();
}
}
if (params.get("lpid") != null) {
String t_lpid = params.get("lpid");
Matcher matcher = pattern.matcher(t_lpid);
if (matcher.matches()) {
param = "/cgi-bin/Findphones.pl?id=" + t_lpid.trim();
}
}
String findphoneUrl= "http://Findphone.com" + param;
wpUrl = findphoneUrl;
}
我的问题是窗口打开时是空白的,没有传递我正在框架中分配给wpurl的URL。
请帮助我解决这个问题。