Galera,
estou usando um modalPanel pra mostrar uma janela de confirmação ao
tentar remover um registro da tabela.
Meu problema é que,independente de qual registro eu escolhi pra
apagar,o objeto que está sendo passado pro método ‘remover’ é sempre o
último que foi adicionado.
Segue o código:
//Modal Panel de confirmação
rich:modalPanel id="confirmation" width="250" height="150">
<f:facet name="header">Confirmação</f:facet>
<h:panelGrid>
<h:panelGrid columns="2">
<h:graphicImage value="/alert.png" />
<h:outputText value="Are you sure?" style="FONT-SIZE: large;" />
</h:panelGrid>
<h:panelGroup>
<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" /
></h:panelGroup>
</h:panelGrid>
</rich:modalPanel>
//Aqui deveria estar sendo passado o objeto da coluna clicada para
remoção
<rich:column>
<a4j:commandLink id="commandRemover" styleClass="buttonRemover"
value=""
onclick="#{rich:component('confirmation')}.show();return false">
<f:setPropertyActionListener value="#{row}"
target="#{pessoaController.pessoa}" />
<a4j:jsFunction reRender="listaPessoa" name="submit"
action="#{pessoaController.remover}" />
</a4j:commandLink>
</rich:column>