Boa tarde galera…
Eu fiz um modalpanel no richfaces para dar aviso de uma deleção…só q o modal abre e fecha logo em seguinda (nao era para fazer isso)…
minha pagina:
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sistema Integrado Samos.</title>
<script type="text/javascript" src="/jquery.maskedinput-1.2.1.js"></script>
</head>
<body>
<f:view>
<h:form id="formlistacadfun">
<rich:panel>
<f:facet name="header">
<h:outputText value="Consulta de Funcionários."/>
</f:facet>
<h:panelGrid columns="5" >
<h:outputText value="Conteúdo" />
<h:inputText value="#{cadfuncontroller.conteudoOrdem}"/>
<h:outputText value="Ordem" />
<h:selectOneMenu binding="#{cadfuncontroller.selecionaOrdem}" value="#{cadfuncontroller.ordenacao}">
<f:selectItems value="#{cadfuncontroller.ordem}" />
</h:selectOneMenu>
<a4j:commandLink value="Buscar" reRender="listafuncionario" />
</h:panelGrid>
<br />
<h:commandLink value="Novo Cadastro" action="cadfun" actionListener="#{cadfuncontroller.novo}" />
<br />
<h:outputText value="1" />
<h:message for="id_exclui" />
<br />
<h:outputText value="2" />
<h:message for="comando_excluir" />
<br />
<br />
<rich:dataTable id="listafuncionario" value="#{cadfuncontroller.listPessoa}" var="lista" rows="15">
<h:column>
<f:facet name="header">
<h:outputText value="Código"></h:outputText>
</f:facet>
<h:outputText value="#{lista.FUNCOD}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Nome"></h:outputText>
</f:facet>
<h:outputText value="#{lista.FUNNOM}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Município"></h:outputText>
</f:facet>
<h:outputText value="#{lista.FUNMUN}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="UF"></h:outputText>
</f:facet>
<h:outputText value="#{lista.FUNEST}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Alterar"></h:outputText>
</f:facet>
<h:commandLink value="Alterar"
action="cadfun" actionListener="#{cadfuncontroller.escolherFuncionario}" >
<f:param id="id_alterar" name="id_alterar" value="#{lista.FUNKEY}" />
</h:commandLink>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Excluir"></h:outputText>
</f:facet>
<h:commandLink id="comando_excluir" value="Excluir" actionListener="#{cadfuncontroller.excluir}">
<rich:componentControl id="menssgem_deleta" for="panel" attachTo="comando_excluir" operation="show" event="onclick"/>
<f:param id="id_excluir" name="id_excluir" value="#{lista.FUNKEY}" ></f:param>
</h:commandLink>
</h:column>
<f:facet name="header">
<rich:datascroller />
</f:facet>
<f:facet name="footer">
<rich:datascroller />
</f:facet>
</rich:dataTable>
</rich:panel>
<rich:modalPanel id="panel" width="350" height="100">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Cadastro de Funcionário"></h:outputText>
</h:panelGroup>
</f:facet>
<h:outputText value="Funcionário excluído com sucesso."></h:outputText>
<br />
<h:commandLink value="Sair" id="sairmodal"></h:commandLink>
<rich:componentControl for="panel" attachTo="sairmodal" operation="hide" event="onclick"/>
</rich:modalPanel>
</h:form>
</f:view>
</body>
</html>