i want to open new page as new window...
in the beginning i used apex:CommandLink and target="_blank"
and it worked well.
But i want to add validation in java-script so i used in Apex:ActionFunction
So i want to know how can i open new page from action function in new Window .
I appreciate if you can answer...
Javascript:
function PdfReport(id)
{
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;
}
exportPdf();
}
Apex page:
<apex:actionFunction action="{!Export}" name="exportPdf" />
<apex:commandLink rendered="{!visible}" styleClass="exportTo" value="export result to Pdf" id="exportPdf" target="_blank"
onclick="PdfReport('mainPage:mainForm:pageBlock:sectionSearch:searcResult_:result:blockdetail'); return false"/>