I am trying to delete data table values. my data tables shows lot of values. when i click to delete particular row in my data table then confirmation dialog box open. if click okay then call to bean and delete that values to database. if click cancel then not to call to bean.. this is my functionality..
ex: my data table show 10 rows. when i select 1 rows delete button clicked call to bean but its get another rows values pass to bean...
my UI code..
<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>