我在单击命令按钮时添加行动态。其中我有两个文本字段和一个下拉列表,最后一列已保存。我能够保存已经在数据库中的旧数据,但无法保存新添加的行。当我单击保存 commandLink 时,实际上控制没有到达 bean。
<div>
<div class="float_right">
<p:commandButton styleClass="add_uom"
value="#{msg['uom.add.new.uom']}" process="@this"
actionListener="#{uomBean.addRow}" immediate="true"
update=":uomFormId:languageDetail">
</p:commandButton>
</div>
<div class="clear"> </div>
<div>
<h:panelGroup id="languageDetail">
<table width="100%" cellspacing="1" cellpadding="1"
border="0" class="role_detail_section">
<thead>
<tr>
<ui:repeat var="language" value="#{uomBean.languageList}">
<th>#{language.languageCode}</th>
</ui:repeat>
<th>#{msg['uom.measuremnet.type.heading']}</th>
<th>#{msg['uom.save']}</th>
<th>#{msg['uom.activate.deactivate.heading']}</th>
</tr>
</thead>
<tbody>
<ui:repeat var="uom" value="#{uomBean.uomDTOList}">
<tr>
<ui:repeat var="uomCountry" value="#{uom.uomList}">
<td><h:inputText styleClass="values"
value="#{uomCountry.languageValue}" /></td>
</ui:repeat>
<td><h:selectOneMenu
value="#{uom.measureTypeId}"
required="true"
requiredMessage="#{msg['uom.measurement.error.msg']}">
<f:selectItem itemLabel="Select" itemValue="0" />
<f:selectItems value="#{uomBean.measureList}"
var="uomtDTO"
itemLabel="#{uomtDTO.measurmentTypeValue}"
itemValue="#{uomtDTO.measurmentTypeId}" />
</h:selectOneMenu></td>
<td>
<p:commandLink value="Saving.." action="#{uomBean.testUOM()}" ></p:commandLink>
</td>
</td>
</tr>
</ui:repeat>
</tbody>
</table>
</h:panelGroup>
<h:messages globalOnly="true" />
</div>
</div>
UOMDTO 是
private Country country;
private Language language;
private String uomDisplayName;
private String uomDescription;
private List<UOMDetailDTO> uomList;
private Integer measureTypeId;
和 UOMDetailDTO 是
private String languageName;
private String languageCode;
private String languageValue;