2

I am new to Primefaces and currently using primefaces 6.0, I am trying to run an online example from the primefaces official site.

The example demonstrates the use of dialog and I followed it just as I saw it used in example however I observed that the page displays the value of the dialog tags header attribute followed by the content of the dialog as text

I would like some to advise me what I am doing wrong see the below code on my view and screenshot of resulting page

 <?xml version="1.0" encoding="UTF-8"?>
    <!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:p="http://primefaces.org/ui">

    <h:panelGrid columns="1" cellpadding="5">

    <p:commandButton value="Basic" type="button" onclick="PF('dlg1').show();" 
    />

     <p:commandButton value="Modal" type="button" onclick="PF('dlg2').show();" />

    <p:commandButton value="Effects" type="button" onclick="PF('dlg3').show();" /> 

     </h:panelGrid>


    <p:dialog header="Basic Dialog" widgetVar="dlg1" minHeight="40">
    <h:outputText value="Resistance to PrimeFaces is futile!" />
    </p:dialog>


     <p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" 
     height="100">
    <h:outputText value="This is a Modal Dialog." />
    </p:dialog> 


    <p:dialog header="Effects" widgetVar="dlg3" showEffect="explode" 
     hideEffect="bounce" height="100">
    <h:outputText value="This dialog has nice effects." />
    </p:dialog>
    </html>

enter image description here

jaysman
  • 51
  • 5
  • Possible duplicate of [PrimeFaces CSS look'n'feel missing and JS "Uncaught Reference Error: PrimeFaces is not defined"](https://stackoverflow.com/questions/14553417/primefaces-css-looknfeel-missing-and-js-uncaught-reference-error-primefaces) – Jasper de Vries Apr 24 '19 at 06:07

1 Answers1

1

you must have h:head tag in your page.

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>

http://primefaces.org/faq.html