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
Post a Comment