Olá, pessoal
Abaixo tenho uma janela modal, pela qual seria usada para excluir um devido registro.
Tudo bem, isto é feito, porém ao excluir a janela não é fechada.
Apenas o botão cancelar pode ser usado para fechar a janela, mas não o excluir.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<rich:popupPanel id="modalPanelExclusaoDoador" autosized="true"
width="300" height="110" header="Confirmação de exclusão">
<h:panelGrid columns="1">
<h:outputText value="Deseja realmente excluir o item?" />
<h:panelGroup>
<h:commandButton value="Excluir" onclick="jsExcluir();" />
<h:outputText value="" />
<h:commandButton value="Cancelar"
onclick="#{rich:component('modalPanelExclusaoDoador')}.hide(); return false;" />
</h:panelGroup>
</h:panelGrid>
<a4j:jsFunction name="jsExcluir" action="#{doadorBean.excluir}"
render="@form" immediate="true" execute="@this"
onclick="#{rich:component('modalPanelExclusaoDoador')}.hide(); return false;">
</a4j:jsFunction>
</rich:popupPanel>
</html>
Uso isto para chamá-lo em uma DataTable:
<a4j:commandLink id="linkExcluir" title="Excluir" execute="@this"
render="@none"
oncomplete="#{rich:component('modalPanelExclusaoDoador')}.show()">
<f:setPropertyActionListener value="#{_doadores}"
target="#{doadorBean.doadorEdicao}">
<a4j:param value="#{_doadores}"></a4j:param>
</f:setPropertyActionListener>
<h:graphicImage library="images" name="excluir.jpg"
title="Excluir" styleClass="imagemLink" />
</a4j:commandLink>
Fico grato se puderem ajudar.