jquery - Access to primefaces widgetvars on document ready -


im trying access primefaces components on document ready this:

$(function() {   var showdialog = geturlparameter("showdialog");   if (showdialog == "true") {     pf('mydialog').show();   } }); 

but in moment primefaces widgetvars not available , following error:

widget var 'mydialog' not available!

when primefaces widgetvars ready accessed?

i had success adding javascript initialization code in page after component widgetvar, ie

<p:datatable widgetvar="test">  </p:datatable>  <script  type="text/javascript">   $(document).ready(function()  {      pf('test'); // access , whatever here  } </script>  

putting script tag before p:datatable doesn't work.

more info here: http://forum.primefaces.org/viewtopic.php?f=3&t=35718


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -