PrimeFaces Tabview选项卡更改不起作用

问题描述:

我有3个选项卡的简单流程。我已经在展示上测试了简单的tabview示例。 但是当我用我的内容更改第一个选项卡时,我无法切换到其他选项卡。PrimeFaces Tabview选项卡更改不起作用

请指导我什么是错的,需要改变。 早些时候我使用了向导,但我在那里有相同的标签更换问题,因为每次点击时都会将我带到最后一个标签。 和现在面临的另一个问题TabView的

我张贴的代码:

<h:form id="compositionmaster"> 
    <p:tabView id="tabView"> 

    <p:tab id="tab1" title="Committee Details"> 

       <h:panelGrid columns="2" columnClasses="label, value"> 
        <h:outputText value="Committee Type: " /> 
        <p:selectOneMenu id="type" value="#{userWizard.comm.committeeType}" effect="fade"> 
         <f:selectItem itemLabel="----Select----" itemValue="0" /> 
         <f:selectItem itemLabel="New" itemValue="1" />     
         <f:selectItem itemLabel="Existing" itemValue="2" /> 

        </p:selectOneMenu> 

        <h:outputText value="Concerned Division: " /> 
        <p:selectOneMenu id="division" value="#{userWizard.comm.committeeSubType}" effect="fade"> 
         <f:selectItem itemLabel="----Select----" itemValue="0" /> 
         <f:selectItem itemLabel="Administration" itemValue="1"/> 
         <f:selectItem itemLabel="Finance" itemValue="2" /> 
         <f:selectItem itemLabel="Marketing" itemValue="3" /> 
         <f:selectItem itemLabel="Others" itemValue="4" /> 
        </p:selectOneMenu> 

        <h:outputText value="Committee Name: " /> 
        <p:inputText value="#{userWizard.comm.committeeName}" maxlength="100"/> 

        <h:outputText value="Subject: " /> 
        <p:inputText value="#{userWizard.comm.committeeSubject}" maxlength="100" /> 

        <h:outputText value="Description: " /> 
        <p:inputText value="#{userWizard.comm.committeeDescription}" maxlength="500" /> 

        <h:outputText value="Tenure of Committee: " /> 
        <p:panelGrid columns="2" > 
         <p:inplace id="Tenure" label="From"> 
          <p:calendar value="#{userWizard.comm.startDate}" id="start" showOn="button" /> 
         </p:inplace> 
         <p:inplace label="To"> 
          <p:calendar value="#{userWizard.comm.endDate}" id="end" showOn="button" /> 
         </p:inplace> 
        </p:panelGrid> 
        <h:outputText value="Add Document: " /> 

        <h:form enctype="multipart/form-data"> 

         <p:fileUpload fileUploadListener="#{fileBean.handleFileUpload}" mode="advanced" update="messages" multiple="true" sizeLimit="100000" allowTypes="/(\.|\/)(gif|jpe?g|png|doc|pdf)$/"/> 

        </h:form> 
       </h:panelGrid>  
     </p:tab> 

    <p:tab id="tab2" title="Godfather Part II"> 
     <h:panelGrid columns="2" cellpadding="10"> 

      <h:outputText id="tab2Text" value="stature grows."/> 
     </h:panelGrid> 
    </p:tab> 

    <p:tab id="tab3" title="Godfather Part III"> 
     <h:panelGrid columns="2" cellpadding="10"> 

      <h:outputText id="tab3Text" value="After a promise that his family would one day be completely legitimate."/> 
     </h:panelGrid> 
    </p:tab> 

</p:tabView> 

</h:form> 

不要使用嵌套形式

HTML不允许嵌套形式,所以你不应该他们在primefaces使用它们可能会导致不良行为。

参见:other计算器questions,或事情,以避免在JSF好的收集:here(注2点)

这是我在你的代码中看到的唯一问题。除此之外,在极少数情况下,如果使用ajax而不处理整个表单,可能会遇到问题。但正如我所看到的,在你的代码中并非如此。

+0

哦!我认为这就是我的大部分组件不能正常工作的原因。非常感谢 – 2013-04-24 05:49:43