【发布时间】:2012-01-13 11:27:37
【问题描述】:
我实现了 selectableDataModel 并扩展了 ListDataModel 我可以很好地看到表格的内容。
<h:form>
<p:dataTable id="selectProductTable" var="product" value="#{manageFormsView.productModel}" selection="#{manageFormsView.product}" >
<p:column selectionMode="single"/>
<p:column>
<f:facet name="header">
<h:outputText value="Urun Ismi" />
</f:facet>
<h:outputText value="#{product.name}" />
</p:column>
</p:dataTable>
<h:panelGrid columns="2">
<p:commandButton action="#{manageFormsView.setSelectedProductToForm}"
update="main_form"
oncomplete="if(#{manageFormsView.errorText == 'SUCCESS'}){ selectProductDlg.hide();}"
value="sec">
</p:commandButton>
<p:commandButton onclick="selectProductDlg.hide();" action="#{manageFormsView.cancelSetRequest}"
value="Iptal">
</p:commandButton>
</h:panelGrid>
</h:form>
但是当我在setSelectedProductToForm 函数中单击“sec”时,我希望看到manageFormsView.product 的内容,但它为空。
可能是什么问题?
谢谢
【问题讨论】:
-
你有没有注意到“sec”的更新设置为update="main_form",而你的表单没有id?
标签: jsf primefaces