最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I open a Popup in JSF - Stack Overflow

programmeradmin1浏览0评论

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
Add a ment  | 

1 Answer 1

Reset to default 4

try 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);
发布评论

评论列表(0)

  1. 暂无评论