【发布时间】:2012-03-30 17:57:24
【问题描述】:
我面临着非常奇怪的问题。在我这边调试之后,我想在论坛上发布同样的问题。
问题::我有 2 个 JSF 数据表,分别是“TableA”和“TableB”。我在 TableB 中有一些元素,现在我想根据条件移动一些文章以移动到 TableA 并在 TableB 中被删除或不可见。
我可以在 TableA 中添加元素,并且可以通过调试器看到该元素已从 TableB 中删除,因为我打印了 TableB 中存在的元素,但相同的更改不会反映在 UI 上。
代码是:
<div id="selectedTableId" class="ArtSlected">
<h:dataTable id="selectedArtTable" value="#{articleBean.artList1}" var="sel" width="100%" border="0" cellspacing="0"
cellpadding="0" columnClasses="center" class="TableStyle">
<h:column>
<h:commandButton id="deleteArticle" image="../resources/images/Delete.png" action="#{articleBean.deleteAction}">
<f:setPropertyActionListener target="#{articleBean.articuloPromocionVO}" value="#{sel}"/>
<f:ajax render=":articleSelectionForm:artDescTable selectedArtTable" execute="@form"/>
</h:commandButton>
</h:column>
<h:column>
<f:facet name="header">#{msgs.mpromo_article_selection_articles_selected}</f:facet>
#{sel.articuloNombre} - #{sel.descripcion}
</h:column>
</h:dataTable>
</div>
这里,articleSelectionForm 是表单名称 artDescTable 是指 TableA selectedArtTable 指的是 TableB。
我为<f:ajax> 标签尝试了许多组合,但没有任何效果。例如,
<f:ajax render=":articleSelectionForm:artDescTable selectedArtTable" execute="@form" />
<f:ajax render=":articleSelectionForm:artDescTable :articleSelectionForm:selectedArtTable" execute="@form" />
<f:ajax render=":articleSelectionForm:artDescTable :articleSelectionForm:selectedTableId:selectedArtTable" execute="@form" />
请告诉我哪里理解有误。
【问题讨论】:
-
我是否正确地阅读了您的代码,您有两种形式?
-
嗨,马特,我只有一个表格