Boa tarde galera, tudo bem?
Não sei se algum de vocês já passaram por essa situação, do popup panel não funcionar em uma aplicação.
Para ter certeza, criei no mesmo projeto uma página com o mesmo código que é disponibilizado no Showcase do Richfaces e mesmo assim não funcionou!
Meu código:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<head>
<title>Gestão Musical</title>
<link rel="stylesheet" type="text/css" href="../estilos/estilos.css"/>
</head>
<body>
<f:view>
<h:form>
<h:outputText styleClass="titulo" value="Cadastro de Gêneros"></h:outputText>
<rich:panel style="height: 15px;" />
<h:dataTable var="genero" value="#{generoBean.generos}">
<h:column>
<f:facet name="header">
<h:outputText value="Código"/>
</f:facet>
<h:outputText value="#{genero.codigo}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Nome"/>
</f:facet>
<h:outputText value="#{genero.nome}"/>
</h:column>
<h:column>
<a4j:commandLink actionListener="#{generoBean.alteraGenero}" value="Alterar">
<f:setPropertyActionListener value="#{genero}" target="#{generoBean.genero}" />
</a4j:commandLink>
</h:column>
<h:column>
<h:commandLink value="Excluir" >
<rich:componentControl target="popup" operation="show" />
</h:commandLink>
</h:column>
</h:dataTable>
<rich:panel style="height: 50px;" />
<h:panelGrid columns="2">
<h:column>
<h:outputText value="Nome"/>
</h:column>
<h:column>
<h:inputText value="#{generoBean.genero.nome}"/><p/>
</h:column>
<h:column>
<h:commandButton actionListener="#{generoBean.addGenero}" value="Adicionar"/>
</h:column>
<h:column>
<h:commandButton actionListener="#{generoBean.limpaCampos}" value="Limpar Campos"/>
</h:column>
</h:panelGrid>
<rich:popupPanel id="popup" modal="true" resizeable="true" onmaskclick="#{rich:component('popup')}.hide()">
<f:facet name="header">
<h:outputText value="Simple popup panel" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
<p>You can also check and trigger events if the use clicks outside of the
panel.</p>
<p>In this example clicking outside closes the panel.</p>
</rich:popupPanel>
</h:form>
</f:view>
</body>
</html>
Código do shwocase:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:commandButton value="Call the popup">
<rich:componentControl target="popup" operation="show" />
</h:commandButton>
<rich:popupPanel id="popup" modal="true" resizeable="true"
onmaskclick="#{rich:component('popup')}.hide()">
<f:facet name="header">
<h:outputText value="Simple popup panel" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('popup')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
<p>You can also check and trigger events if the use clicks outside of the
panel.</p>
<p>In this example clicking outside closes the panel.</p>
</rich:popupPanel>
</ui:composition>
Por favor, me ajudem!
Obrigado!
Guri.