OnLoad P:dialog?
try :
or you can implement your own javaScript to test some conditions then show or hide your dialog
for example :
then :
Code: Select all
<h:body onLoad="dialog.show()">
<p:dialog widgetvar="dialog"/>
</h:body>
for example :
Code: Select all
function showDialog(){
if(Condition){
dialog.show();
}else{
dialog.hide();
}
}
Code: Select all
<h:body onLoad="showDialog();">
<p:dialog widgetvar="dialog"/>
</h:body>
Last edited by mouadh on 21 Oct 2010, 17:36, edited 1 time in total.
Ben Khalifa Mouadh
engineering student at National School of Computer Sciences - Tunisia
JSF 2.0, GlassFish v3, PF 2.0.1,Majorra 2.0.2, netBeans 6.8
engineering student at National School of Computer Sciences - Tunisia
JSF 2.0, GlassFish v3, PF 2.0.1,Majorra 2.0.2, netBeans 6.8
Hello, I am using Primefaces Mobile 5.3 and onload="true" won't make a dialog show when page loads. Is it not working anymore and there is a different approach?
(I put the p:dialog inside pm:content... it is working when executed from a onclick="" in a button as usually, but ignoring onload="true")
thanks.
(I put the p:dialog inside pm:content... it is working when executed from a onclick="" in a button as usually, but ignoring onload="true")
thanks.
-
- Posts: 1
- Joined: 06 Mar 2016, 02:27
it's a little late so i post my answer for further readers:
Just use Jquery. and PF selector for widgets
Where dlgWidget it's the value of widgetVar attribute in dialog
Just use Jquery. and PF selector for widgets
Code: Select all
<script>
$(function() {
PF('dlgWidget').show();
});
</script>
Yes, I agree with robertoteles. I put my dialog show call in the JQuery onload method, i.e.
works great!
Code: Select all
<script type="text/javascript">
jQuery(document).ready(function ($) {
PF('dlgSearchType').show();
});
</script>
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
just set "visible=true"
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
-
- Information
-
Who is online
Users browsing this forum: No registered users and 46 guests