JSF에서 <p:commandButton>
버튼을 클릭하여 새 팝업 창을 열려고합니다. 여기 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을 통과하지 않고 창이 비어있는 것입니다.
이 문제를 해결하는 데 도움을주십시오.
commandButton에 update = "@ all"속성을 추가해보십시오. 귀하의 문제는 응답으로보기를 업데이트하지 않고 아약스 호출을 사용하려고하므로 wpUrl의 값이 오래되었다는 것입니다 (비어 있음). – Yamada
@yamada : 나는이 코드를 사용하여 backing bean에 매개 변수를 전달하려고합니다. 명령 단추를 클릭하지만 값을 가져올 수 없습니다. –
techy360