簡體   English   中英

Primefaces commandButton在輪播中不起作用

[英]Primefaces commandButton not work inside a Carousel

我正在使用Primefaces 4.0和jsf 2.0。

我正在嘗試在Carousel內的Primefaces命令按鈕中調用托管bean的方法,但是它不起作用。 看來該按鈕無法調用該方法。 什么都沒發生...

因此,我一直在尋找,但是找不到任何可以幫助我解決該問題的東西。

我的代碼如下:

Page.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" xml:lang="en" lang="en"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>

<h:body>

<h:form id="form">
<p:carousel id="tabsCarousel" numVisible="1" itemStyle="height:500px;width:800px;" effect="easeInStrong">  
    <p:tab title="Godfather Part I">  

        <h:panelGrid columns="2" cellpadding="10">   
            <p:graphicImage value="/images/godfather/godfather1.jpg" />  
            <h:outputText  value="Some text" />  
                <p:commandButton value="ok" action="#{bean.test}"  />
        </h:panelGrid>  
    </p:tab>
</p:carousel> 
</h:form> 
</h:body>
</html>

和托管bean的方法

    public void test(){
         System.out.print("Here!");
    }

OBS:May bean的范圍是ViewScoped。

請!

謝謝 !!!!!

這似乎與這個已報告的問題有關 ,即使應該將其標記為已修復為3.5,我也已使用3.5和4(社區版本)對其進行了測試,並且仍然存在。 還有另一個針對該問題的報告 ,就像您的情況一樣,使用了p:tab組件而不是p:column

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM