PrimeFaces commandButton needs to validate two calendar component and then redirect an external URL that contains the two calendar value to a new page
===

I'm new to JSF and primefaces and I'm trying to do the following: I have to create a URL that contains two date and then open it in a new page. I'm using primefaces, so I create two p:calendar component, and a p:commandButton.

My problem is, that I managed to validate the calendars and after that open the URL, but in the same window. If I set ajax="false" to the commandbutton, and target="_blank" to the form, then it opens the URL in a new page, but if the calendars value are invalid, then it also opens the original page in a new page with the validation message. For redirection I use FacesContext.getCurrentInstance().getExternalContext().redirect(URL) in my bean.

I also tried to redirect using h:outputLink and set its value to bean.url and target="_blank". It redirects to a new page, but in this case I didn't manage to validate the calendars.

How can I do this?  
Thanks!