Primefaces命令按钮在旋转木马内不起作用



我使用的是Primefaces 4.0和jsf 2.0。

我试图在旋转木马内的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,就像您的情况一样。

最新更新