jsf - Dialog element of primefaces not working -


i trying use dialog element of primefaces not working. have tried same code provided in primefaces site. code not working.

            <h:panelgrid columns="1" cellpadding="5">                 <p:commandbutton id="basic" value="basic" onclick="pf('dlg1').show();" type="button" />                  <p:commandbutton id="modaldialogbutton" value="modal" onclick="pf('dlg2').show();" type="button"/>                  <p:commandbutton id="effectsdialogbutton" value="effects" onclick="pf('dlg3').show();" type="button" />                 </h:panelgrid>                   <p:dialog id="basicdialog" header="basic dialog" widgetvar="dlg1" appendtobody="false">                  <h:outputtext value="resistance primefaces futile!" />                     </p:dialog>                      <p:dialog id="modaldialog" header="modal dialog" widgetvar="dlg2" modal="true" height="100" appendtobody="false">                         <h:outputtext value="this modal dialog." />                     </p:dialog>                      <p:dialog header="effects" widgetvar="dlg3" showeffect="explode" hideeffect="bounce" height="100" appendtobody="false">                         <h:outputtext value="this dialog has nice effects." />                     </p:dialog> 

this header of page:

    <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"          "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">    <html xmlns="http://www.w3.org/1999/xhtml"   xmlns:h="http://java.sun.com/jsf/html"   xmlns:f="http://java.sun.com/jsf/core"   xmlns:p="http://primefaces.org/ui"> 

try opening dialog so:

<p:dialog id="modaldialog" header="modal dialog" widgetvar="dlg2" modal="true" height="100" appendtobody="false">            <h:outputtext value="this modal dialog." /> </p:dialog>  <p:commandbutton id="modaldialogbutton" value="modal" onclick="dlg2.show();" type="button" process="@this" update="@none"/> 

please post header of xhtml file , state version of primefaces using.

the following call:

pf('dlg2').show();  

does not work primefaces v3.5 works 4.0 , up. version 4.0 supports

dlg2.show(); 

and

dlg2.hide(); 

but not long, deprecated in future versions use pf('dlg2').show();


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -