Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dialog framework doesn't work

i am trying to apply the basic sample for rendering a page inside a dialog as in the showcase http://www.primefaces.org/showcase/ui/dialogFrameworkBasic.jsf

  • my web pages are under webapp/pages/general
  • i am running PrimeFaces-4.0-SNAPSHOT on Mojarra-2.1.20
  • i have two pages: 1- home.xhtml 2- viewreport.xhtml

1- home.xhtml:

<?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:f="http://java.sun.com/jsf/core"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:p="http://primefaces.org/ui"
    xmlns:pretty="http://ocpsoft.com/prettyfaces"
    xmlns:sec="http://www.springframework.org/security/tags"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>


    <title>Welcome</title>
    <h:outputStylesheet library="css" name="style.css" />
</h:head>

<h:body dir="rtl">

    <h:form>
        <p:commandButton value="View" icon="ui-icon-extlink"
            action="dialog:viewreport" />
    </h:form>

</h:body>

</html>

2- viewreport.xhtml:

<!DOCTYPE html>
<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:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

<h:head>

</h:head>

<h:body>
    <h:panelGroup id="report_details_new" layout="block" style="width:500px;height:500px;">

      HELLO WORLD


    </h:panelGroup>
   </h:body>

   </html>

when clicking on the button, nothing happens, i don't get any errors in eclipse console or in browser console.

please advise why the dialog framework is not working.

like image 625
Mahmoud Saleh Avatar asked Apr 30 '13 14:04

Mahmoud Saleh


1 Answers

Solved by adding the following configuration to the faces-config.xml:

    <action-listener>org.primefaces.application.DialogActionListener</action-listener>
    <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
    <view-handler>org.primefaces.application.DialogViewHandler</view-handler>

tested on IE9,Chrome,Firefox for primefaces 4.0-SNAPSHOT

like image 129
Mahmoud Saleh Avatar answered Oct 19 '22 08:10

Mahmoud Saleh