I need to open a Popup window on clicking a button in a xhtml page. I have written something like that:
<p:mandButton type="submit" value="Select User" onclick="showGrpMemberSearchPageCalenderLeave()"/>
and the java script is like:
function showGrpMemberSearchPageCalenderLeave()
{
window.open('./SearchGroupMembersLeaveCalander.xhtml,resizable=no,
toolbar=no,scrollbars=yes,height=450,width=530,top=145,left=235');
return true;
}
But it just opens the page in the current window, no pop up window is opening.Please suggest.
I need to open a Popup window on clicking a button in a xhtml page. I have written something like that:
<p:mandButton type="submit" value="Select User" onclick="showGrpMemberSearchPageCalenderLeave()"/>
and the java script is like:
function showGrpMemberSearchPageCalenderLeave()
{
window.open('./SearchGroupMembersLeaveCalander.xhtml,resizable=no,
toolbar=no,scrollbars=yes,height=450,width=530,top=145,left=235');
return true;
}
But it just opens the page in the current window, no pop up window is opening.Please suggest.
Share Improve this question edited Jun 18, 2013 at 6:27 Alexandre Lavoie 8,7793 gold badges32 silver badges73 bronze badges asked Jun 18, 2013 at 6:09 NDeveloperNDeveloper 3,1977 gold badges26 silver badges35 bronze badges 4- take a look at these tutorials – ClydeFrog Commented Jun 18, 2013 at 6:15
-
You should return false to stop
p:mandButton
further processing, also do the change proposed by @Markipe's answer – Alexandre Lavoie Commented Jun 18, 2013 at 6:35 -
1
Just use
<p:dialog>
instead of all that mess? – BalusC Commented Jun 18, 2013 at 13:15 - @BalusC I enough googled and everyone provided solution around the <P:dialog>. I am not able to use because of it's library support. I found that dialog attribute is supported by primefaces/ui library. I think this is primefaces library. Can you please guide me about this. – kailash gaur Commented Oct 26, 2015 at 17:29
1 Answer
Reset to default 4try this one instead
function showGrpMemberSearchPageCalenderLeave() {
window.open('./SearchGroupMembersLeaveCalander.xhtml','mywindow', 'resizable=no,toolbar=no,scrollbars=yes,height=450,width=530,top=145,left=235');
return true;
}
Syntax
window.open(url, windowName, specs);