Jsf 富数据表值选择问题
我正在尝试删除数据表值。我的数据表显示了很多值。当我单击以删除数据表中的特定行时,确认对话框将打开。若单击OK,那个么调用bean并将该值删除到数据库中。如果单击“取消”,则不调用bean。。这是我的功能 例: 我的数据表显示了10行。当我选择1行删除按钮时,单击调用bean,但它的get-other-rows值传递给bean 我的UI代码Jsf 富数据表值选择问题,jsf,richfaces,Jsf,Richfaces,我正在尝试删除数据表值。我的数据表显示了很多值。当我单击以删除数据表中的特定行时,确认对话框将打开。若单击OK,那个么调用bean并将该值删除到数据库中。如果单击“取消”,则不调用bean。。这是我的功能 例: 我的数据表显示了10行。当我选择1行删除按钮时,单击调用bean,但它的get-other-rows值传递给bean 我的UI代码 <h:commandButton image="/images/remove.png" onclick="# {rich:compone
<h:commandButton image="/images/remove.png" onclick="# {rich:component('confirmation')}.show();return false"/>
<a4j:jsFunction name="submit" action="#{bean.delete}">
<f:setPropertyActionListener target="#{bean.name}" value="#{info.name}" />
</a4j:jsFunction>
<rich:popupPanel id="confirmation" width="250" height="150">
<f:facet name="header">confirmation</f:facet>
<h:panelGrid>
<h:panelGrid columns="2">
<h:graphicImage value="/images/remove.png" />
<h:outputText value="Are you sure?" style="FONT-SIZE: large;" />
</h:panelGrid>
<br></br>
<h:panelGroup >
<center><input type="button" value="OK"
onclick="#{rich:component('confirmation')}.hide();submit();return false" />
<input type="button" value="Cancel"
onclick="#{rich:component('confirmation')}.hide();return false" /> </center>
</h:panelGroup>
</h:panelGrid>
</rich:popupPanel>
确认书
我想这与“AJAX调用不同步”有关
发布的代码缺少表信息,因此我认为它与AJAX处理有关
<rich:extendedDataTable
id="myTable"
value="#{myBean.rows}"
selectionMode="single"
rows="#{crudBean.actionForm.occurrences}"
...
rowKeyVar="idx"
...>
<a4j:ajax event="selectionchange"
listener="#{myBean.selectionListener}"/>
<rich:column width="30px" styleClass="#{rowItem.className}">
<util:myInputText id="status" managedBean="#{myBean}" rowItem="#{rowItem}" rowIndex="#{idx}"/>
</rich:column>
<util:myDeleteRecord id="delete" managedBean="#{myBean}" rowItem="#{rowItem}" rowIndex="#{idx}"/>
</rich:column>
</rich:extendedDataTable>
在我的组件上,我使用:rowIndex=“#{idx}”来确保我知道我正在编辑/删除哪一行您的问题是什么?将错误的值传递到dataTable内部或外部的JSF函数?(我假设“info”是表中的一个变量)最有可能的两个操作是我们的同步操作:删除“当前”行并激活选定行。你能用at代码贴这张表吗?