2013-04-30 63 views
5

我試圖應用基本樣品對話框內呈現頁面作爲展示 http://www.primefaces.org/showcase/ui/dialogFrameworkBasic.jsf對話框架不起作用

  • 我的網頁正在的webapp /頁/一般
  • 我對鑽嘴魚科-2.1.20
  • 運行PrimeFaces-4.0-SNAPSHOT我有兩個頁面: 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> 

上的按鈕點擊時,沒有任何反應,我不會在eclipse控制檯或瀏覽器控制檯中發現任何錯誤。

請告知爲什麼對話框架不起作用。

+1

你需要一個像dialogviewhandler一些配置,dialogactionlistener等等,這些都是無證的,因爲現在的功能是alpha。請參閱showcase的faces-config配置。 – 2013-04-30 14:12:35

回答

8

通過添加下面的配置到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> 

的IE9,Chrome瀏覽器,Firefox的測試primefaces 4.0快照

+0

謝謝,正在殺死我... – rdcrng 2013-05-20 18:48:21

+1

這也需要去: Tim 2013-10-21 00:20:32

+0

@明顯地跳動 – 2013-10-22 09:08:33