OK So after research i cant redirect new page in new window from server side , so used in other method : first of all i make validation in java script and if it return true the action in the controller running ,
JavaScript
function PdfReport(id,type)
{
var selectCheckbox = false;
var tab = document.getElementById(id).getElementsByTagName("table")[0];
for(j = 0 ; j < tab.rows.length ; j++)
{
if (tab.rows[j].cells[0].querySelector("input[type='checkbox']").checked == true )
{
selectCheckbox = true;
}
}
if(selectCheckbox == false)
{
alert('You must select at least one technology in order to export ');
return false;
}
return true;
}
Apex:
<apex:commandLink rendered="{!visible}" styleClass="exportTo" value="export result to Pdf" id="exportPdf" target="_blank" action="{!Export}" onclick="return PdfReport('mainPage:mainForm:pageBlock:sectionSearch:searcResult_:result:blockdetail','Simple');" />
the idea from : How to add a confirm dialog to a command button?How to add a confirm dialog to a command button?