嗨,我正在使用嵌套的 ui:repeats 来显示我的数据。外部 UI:repeat 可以正常工作并绑定到 bean,但内部不绑定到 bean。总之,我想显示一个人列表,其中每个人都有一个姓名和一个电子邮件地址列表。这是我的代码:
<ui:repeat value="#{myFamily.personList}" var="eachPerson" >
<tr:panelCaptionGroup captionText="#{eachPerson.name}" styleClass="fullWidth">
<h:inputText value="#{eachPerson.age}" styleClass="fullWidth" />
<ui:repeat value="#{eachPerson.emailList}" var="eachEmail" >
<h:panelGrid columns="2">
<h:outputLabel value="#{eachEmail.type}:" styleClass="darkBlue label" />
<h:inputText value="#{eachEmail.email}" maxlength="40" size="38" />
</h:panelGrid>
</ui:repeat>
</tr:panelCaptionGroup>
</ui:repeat>
与 personList 的绑定很好,因为我通过更改每个人的年龄进行了测试,并且模型在我提交后发生了更改。但是,无论我在屏幕上进行什么更改,电子邮件列表都不会更改。
请帮忙!我正在使用 JSF、Spring Web Flow、Facelets 和 Trinidad。