MY issue is similar to this issue
I am having an in XHTML and it calls the backing bean method for invoking a new window with an pre constructed URL.But my problem is its not opening the URL.
My code in the XHTML is given below
<h:commandButton style="margin-left:1em;width: auto; height: 20px;font-size:85%"
value="WebPhone" id="lwebpne"rendered="#{Bean.editCmdActionflg == true and (Bean.selectedSearchSysDetRow.isfeed != '1' or Bean.selectedOverviewDetails.webPheFlg == false)}"actionListener="#{Bean.webPhoneSearch}" >
<f:param name="lpid" value="lpid" />
</h:commandButton>
And my code given in the backing bean
public void webPhoneSearch(ActionEvent event) {
logger.info("webPhoneSearch Method Enter ..");
String param = "";
Map<String, String> params = FacesContext.getCurrentInstance()
.getExternalContext().getRequestParameterMap();
if (params.get("lpid") != null) {
System.out.println("coming inside>>>>>");
// String t_lpid = params.get("lpid");
String t_lpid = selectedOverviewDetails.getLeadPrgMgrUid();
Matcher matcher = pattern.matcher(t_lpid);
if (matcher.matches()) {
param = "this values comes from UI ";
}
}
// below is a URL where the window will launch to show the details of a person which we are search for
Url = "http:// URL for searching a person in webphone" +param;
RequestContext.getCurrentInstance().execute(
"window.open('" + Url + "')");
logger.info("webPhoneSearch Method Exit ..");
}<br/>
My problem is clikcing the <h:commandbutton>
does not open a new window instead the same page reopens in the current window when I click the <h:commandbutton>
Please let me know your suggestions to resolve this issue.