admin管理员组文章数量:1356946
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);
本文标签: javascriptHow can I open a Popup in JSFStack Overflow
版权声明:本文标题:javascript - How can I open a Popup in JSF - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744016972a2576508.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论