Problem with af:form to open it in a new tab

Hello

I am trying to open a link in a new tab when you click the button. Here is my code for the same

JSPX

< af:panelGroupLayout id = "pgl47" layout = "horizontal" halign = "left" >

< af:form targetFrame = "_blank" id = "f1" >

< af:commandButton text = "Click me" id = "cb3".

actionListener = "#{pageFlowScope.Bean.method}" > "

< / af:commandButton >

< / af:form >

< / af:panelGroupLayout >

Bean.Method:

the method public void (ActionEvent actionEvent) {}

ectx = FacesContext.getCurrentInstance () .getExternalContext ();

request = (HttpServletRequest) ectx.getRequest ();

session = request.getSession (false);

try {}

ectx.redirect ("https://google.com" "");

} catch (IOException e) {}

}

}

But at the click of the button, my link opens on the same page and not in new tab as expected

Hello

Always mention your JDev version. Specific no reason why you use the command button? Have you tried to use the Go button? You can set the destination and the target to achieve your usecase.

Arun-

Tags: Java

Similar Questions

Maybe you are looking for