我具有其上显示在数据表中的产品的列表,并希望下面的dataTable-popupPanel主详细不保存编辑的值
一个DataTable如所描述的在一个弹出到编辑从数据表中的特定行与所有员工的详细信息一样,每一行都有编辑按钮。单击编辑按钮时,新弹出窗口应显示特定点击产品的现有信息,编辑后必须反映该列表中特定对象的更改以及在数据表中。
我很努力,但我无法保存编辑过的产品中的更改。当弹出窗口打开时,l可以看到所选的项目属性,但当我更改属性时,没有任何更改。 这里是我的jsf代码。
<a4j:outputPanel ajaxRendered="true">
<h:dataTable id="table1" value="#{productBean.products}" var="item"
styleClass="resultTable" headerClass="resultTableHeader"
rowClasses="resultTableRow">
<h:column>
<f:facet name="header">
<h:outputText value="Part#" />
</f:facet>
<h:outputText value="#{item.partNumber}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Product Description" />
</f:facet>
<h:outputText value="#{item.description}" />
</h:column>
<h:column>
<a4j:commandButton value="Edit" action="#{productBean.setEditItem(item)}" oncomplete="#{rich:component('popup')}.show()"> </a4j:commandButton>
<rich:popupPanel id="popup" modal="true" resizeable="true"
onmaskclick="#{rich:component('popup')}.hide()">
<f:facet name="header">
<h:outputText value="Edit property of the product" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('popup')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
<!-- editProduct ı burda item yerine kullan -->
<table style="align: center;">
<tr>
<td><h:panelGrid columns="2">
<h:outputText value="Description"></h:outputText>
<h:inputText value="#{productBean.item.description}"></h:inputText>
</h:panelGrid></td>
</tr>
<tr>
<td><h:panelGrid columns="2">
<h:outputText value="Part Number"></h:outputText>
<h:inputText value="#{item.partNumber}"></h:inputText>
</h:panelGrid></td>
</tr>
</table>
<a4j:commandButton value="Submit" action="#{productBean.actionEditProductsFromDatabase(item)}" execute="@popup"/>
<a4j:commandButton value="Cancel" onclick="#{rich:component('editPane')}.hide(); return false;" />
</rich:popupPanel>
</h:column>
</h:dataTable>
</a4j:outputPanel>
</h:form>