Jsf 2 accordionPanel内datatable中inputText的值错误
我的xhtml中有以下内容Jsf 2 accordionPanel内datatable中inputText的值错误,jsf-2,primefaces,richfaces,Jsf 2,Primefaces,Richfaces,我的xhtml中有以下内容 <p:accordionPanel id="existing-list" value="#{eventBean.registrations}" var="entry" > <p:ajax event="tabChange" listener="#{eventBean.onRegistrationTabChange}" update="existing" /> <
<p:accordionPanel id="existing-list" value="#{eventBean.registrations}" var="entry" >
<p:ajax event="tabChange" listener="#{eventBean.onRegistrationTabChange}" update="existing" />
<p:tab title="#{entry.fullName}" >
<h:panelGrid columns="2" cellpadding="5">
<h:panelGrid id="car" columns="1" border="0" cellpadding="10" cellspacing="1" styleClass="centre-content">
<rich:dataTable value="#{entry.formFields}" var="field" id="table" columnClasses="field-label,field-value">
<rich:column>
<h:outputText value="#{field.fieldLabel}"/>
</rich:column>
<rich:column>
<h:inputText value="#{field.fieldValue}" size="#{field.length}" rendered="#{field.fieldType == 'text'}">
<f:ajax/>
</h:inputText>
</rich:column>
</rich:dataTable>
<h:commandButton action="#{formBean.refreshForm}" immediate="true" styleClass="refresh-button"
style="background-color: white; background-repeat: no-repeat;
background-image: url('images/refresh.gif');background-position: top;background-size: cover;"/>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="5">
<h:commandButton value="Save" action="#{eventBean.savePreviousEntry}" styleClass="mailme-button"/>
<h:commandButton value="Cancel" action="#{eventBean.cancelPreviousEntry}" immediate="true"
styleClass="mailme-button" render="panel-outer"/>
</h:panelGrid>
</h:panelGrid>
</p:tab>
</p:accordionPanel>
registrations是EventRegistration对象的ArrayList,
每个EventRegistration都包含一个FormField对象的ArrayList,
FormField包含fieldLabel和fieldValue的属性
在我的示例中,注册中有32个条目,在每个注册中,ArrayList中有两个FormFields
当显示accordion面板时,您可以依次打开每个选项卡并显示fieldValue属性的正确值,但是当按下Save按钮时,第一次注册的第一个FormField对象的setFieldValue方法将被称为32 TimeSet(列表中的每个注册一次)因此,字段值逐渐被每次注册的相关字段值替换,并以最后一次注册的字段值结束
我在inputText之后添加了f:ajax,以查看字段更改时发生的情况,当焦点离开字段时,这与预期一样有效
我错过了什么
PF 5.3、faces 2.2.8-10、Java 7是否与普通的
ui:repeat
一起工作?我还没有尝试过,我会试一试-谢谢ui:repeat可以工作,谢谢你的建议,看起来p:datatable在手风琴面板中有问题即使在更新版本中也是正确的。检查发行列表