Daniel.F 30 de dez. de 2007
Vc se importa de colocar como ta chamando a janela.
Esse componente do rich faces e meio chatinho tem colocar de java script
Daniel.F 30 de dez. de 2007
Olha só acho que não ajudar muita ,mas tem um jeito mais de fazer
1° Criar o modal:
<rich:modalPanel id="mpAjuda" height="200" width="500">
<f:facet name="header">
<h:outputText value="Ajuda" />
</f:facet>
<h:outputLabel id="help" value="Colocamos aqui o texto de ajuda, que pode estar hard-coded,
ou vinculado a uma chave em arquivo de propriedades ou atributo de um Managed Bean!"/>
<f:facet name="controls">
<h:graphicImage value="#{pageContext.request.contextPath}/images/fechar.jpg"
onclick="Richfaces.hideModalPanel('form1:mpAjuda')" style="cursor:pointer"/>
</f:facet>
</rich:modalPanel>
2° Criar um link chamando o mesmo:
<h:outputLink value= "javascript:Richfaces.showModalPanel('form1:mpAjuda',{width:450, top:200})" >
<h:outputtext value= "ajuda" />
</h:outputLink>
Eu espero ter ajudando ,este exemplo ai é da javamagazine.
carlavb 31 de dez. de 2007
eu fiz assim mesmo…mas nao funciona, não sei pq…o problema do rich faces é que é meio amarrado com skins, css, java script, entao tem que ir nos sources que eles disponibilizam e garimpar essas coisas, eu fiz assim pra implementar uma Tree bonitinha, mas com modalPanel não vai…os exemplos que tenho visto usam facelets, e nao posso usar facelets no trampo… =/
mas obrigada pela ajuda…
carlavb 4 de jan. de 2008
oi, já consegui, era um problema de CSS mesmo
valeu mesmo, gente
guigoerlmartin 10 de fev. de 2008
Carla também tenho problemas com o ModalPanel quanto ao tamanho dele, també fiz a chamada dele como vc porém utilizando um tamanho maior, e não ta rolando…posta ai sua solução
Javabuntu 10 de fev. de 2008
ae pessoal eh bem facil trabalhar com o modal, eu to utilizando pra alguns fins, e vou colocar abaixo, uso pra fazer fazer o login da aplicação;
aqui minha tela de login:
<rich:modalPanel id="mp" minHeight="178" minWidth="300" height="210" width="320" zindex="2000">
<f:facet name="header">
<h:outputText value="Login"/>
</f:facet>
<f:facet name="controls">
<h:graphicImage value="/images/menu/erroFaces.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
</f:facet>
<div style="background-image:url(../images/loginFundo.jpg); background-repeat:no-repeat; height: 178px; margin-top: 0px;margin-left:0px; margin-bottom: 0px;">
<a4j:form id="mpform">
<br/> <br/> <br/> <br/>
<h:outputLabel value="Usuário: " style="margin-left: 1%;font-size:12px; font-color:#0C1174"/>
<h:inputText id="login" style="margin-left:3%; width :137px; " required="true" value="#{userBean.usuario.usuario}"/>
<br/>
<rich:message for="login" style="margin-left:16% ;">
<f:facet name="errorMarker">
<h:graphicImage url="../images/menu/erro.png"/>
</f:facet>
</rich:message>
<br/>
<h:outputLabel value="Senha: " style="margin-left: 1%;font-size:12px;font-color:#0C1174"/>
<h:inputSecret id="senha" style="margin-left:6%; width :137px; " required="true" value="#{userBean.usuario.senha}"/>
<br/>
<rich:message for="senha" style="margin-left:16% ;">
<f:facet name="errorMarker">
<h:graphicImage url="../images/menu/erro.png"/>
</f:facet>
</rich:message>
<br/>
<a4j:commandButton style="margin-left: 17%; font-size:12px;" value="Logar" action="#{userBean.logarUser}"/>
<br/>
</a4j:form>
</div>
</rich:modalPanel>
e aqui minha chamada ao ModalPanel:
<rich:panelMenuItem label="Logar" onclick="javascript:Richfaces.showModalPanel('mp')">
<a4j:support event="onclick" onsubmit="true"/>
</rich:panelMenuItem>
nesta linha eu defino o tamanho que deverá abrir a janela, não precisa passar o valor na chamada…
<rich:modalPanel id="mp" minHeight="178" minWidth="300" height="210" width="320" zindex="2000">
juniorsatanas 28 de jan. de 2010
eu tentei seguindo fazer o que você fez da este erro :
javax . faces . FacesException : Exception while calling encodeBegin on component : { Component - Path : [ Class : org . ajax4jsf . component . AjaxViewRoot , ViewId : / pages / cadastroClientef / cadastraClientef . jsp ][ Class : javax . faces . component . html . HtmlForm , Id : j_id_jsp_1107764850_1 ][ Class : org . richfaces . component . html . HtmlPanelMenuItem , Id : j_id_jsp_1107764850_15 ]}
at javax . faces . component . UIComponentBase . encodeBegin ( UIComponentBase . java : 599 )
at javax . faces . component . UIComponent . encodeAll ( UIComponent . java : 245 )
at javax . faces . component . UIComponent . encodeAll ( UIComponent . java : 257 )
at javax . faces . component . UIComponent . encodeAll ( UIComponent . java : 257 )
at org . apache . myfaces . application . jsp . JspViewHandlerImpl . actuallyRenderView ( JspViewHandlerImpl . java : 427 )
at org . apache . myfaces . application . jsp . JspViewHandlerImpl . renderView ( JspViewHandlerImpl . java : 383 )
at org . ajax4jsf . application . ViewHandlerWrapper . renderView ( ViewHandlerWrapper . java : 100 )
at org . ajax4jsf . application . AjaxViewHandler . renderView ( AjaxViewHandler . java : 176 )
at org . apache . myfaces . lifecycle . RenderResponseExecutor . execute ( RenderResponseExecutor . java : 41 )
at org . apache . myfaces . lifecycle . LifecycleImpl . render ( LifecycleImpl . java : 140 )
at javax . faces . webapp . FacesServlet . service ( FacesServlet . java : 155 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 290 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at org . ajax4jsf . webapp . BaseXMLFilter . doXmlFilter ( BaseXMLFilter . java : 178 )
at org . ajax4jsf . webapp . BaseFilter . handleRequest ( BaseFilter . java : 290 )
at org . ajax4jsf . webapp . BaseFilter . processUploadsAndHandleRequest ( BaseFilter . java : 368 )
at org . ajax4jsf . webapp . BaseFilter . doFilter ( BaseFilter . java : 495 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 235 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at br . com . serjaum . filtro . AuthFilter . doFilter ( AuthFilter . java : 26 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 235 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at org . netbeans . modules . web . monitor . server . MonitorFilter . doFilter ( MonitorFilter . java : 390 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 235 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at org . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperValve . java : 233 )
at org . apache . catalina . core . StandardContextValve . invoke ( StandardContextValve . java : 191 )
at org . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . java : 128 )
at org . apache . catalina . valves . ErrorReportValve . invoke ( ErrorReportValve . java : 102 )
at org . apache . catalina . core . StandardEngineValve . invoke ( StandardEngineValve . java : 109 )
at org . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . java : 293 )
at org . apache . coyote . http11 . Http11Processor . process ( Http11Processor . java : 849 )
at org . apache . coyote . http11 . Http11Protocol $ Http11ConnectionHandler . process ( Http11Protocol . java : 583 )
at org . apache . tomcat . util . net . JIoEndpoint $ Worker . run ( JIoEndpoint . java : 454 )
at java . lang . Thread . run ( Thread . java : 619 )
Caused by : java . lang . NullPointerException
at org . richfaces . renderkit . html . PanelMenuItemRenderer . getFullStyleClass ( PanelMenuItemRenderer . java : 143 )
at org . richfaces . renderkit . html . HtmlPanelMenuItemRenderer . doEncodeBegin ( HtmlPanelMenuItemRenderer . java : 119 )
at org . richfaces . renderkit . html . HtmlPanelMenuItemRenderer . doEncodeBegin ( HtmlPanelMenuItemRenderer . java : 106 )
at org . ajax4jsf . renderkit . RendererBase . encodeBegin ( RendererBase . java : 100 )
at javax . faces . component . UIComponentBase . encodeBegin ( UIComponentBase . java : 596 )
este é meu código:
& lt ; % @ taglib prefix = "sql" uri = "http://java.sun.com/jsp/jstl/sql" %& gt ;
& lt ; % @ page language = "java" contentType = "text/html; charset=UTF-8" pageEncoding = "UTF-8" %& gt ;
& lt ; % @ taglib prefix = "f" uri = "http://java.sun.com/jsf/core" %& gt ;
& lt ; % @ taglib prefix = "h" uri = "http://java.sun.com/jsf/html" %& gt ;
& lt ; % @ taglib prefix = "rich" uri = "http://richfaces.ajax4jsf.org/rich" %& gt ;
& lt ; % @ taglib prefix = "stella" uri = "http://stella.caelum.com.br/faces" %& gt ;
& lt ; % @ taglib prefix = "a4j" uri = "http://richfaces.org/a4j" %& gt ;
& lt ; % @ taglib uri = "http://richfaces.ajax4jsf.org/rich" prefix = "rich" %& gt ;
& lt ; script type = "text/javascript" src = "../js/jquery.maskedinput-1.2.1.js" & gt ; & lt ; / script & gt ;
& lt ;! DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" & gt ;
& lt ; html & gt ;
& lt ; head & gt ;
& lt ; meta http - equiv = "Content-Type" content = "text/html; charset=UTF-8" & gt ;
& lt ;! BGSOUND id = "sound" src = "sounds/cpf.wav" /--& gt ;
& lt ; / head & gt ;
& lt ; body & gt ;
& lt ; f : view & gt ;
& lt ; h : form & gt ;
& lt ; rich : modalPanel id = "mp" minHeight = "178" minWidth = "300" height = "210" width = "320" zindex = "2000" & gt ;
& lt ; f : facet name = "header" & gt ;
& lt ; h : outputText value = "Login" /& gt ;
& lt ; / f : facet & gt ;
& lt ; f : facet name = "controls" & gt ;
& lt ; h : graphicImage value = "/images/menu/erroFaces.png" style = "cursor:pointer" onclick = "Richfaces.hideModalPanel('mp')" /& gt ;
& lt ; / f : facet & gt ;
& lt ; div style = "background-image:url(../images/loginFundo.jpg); background-repeat:no-repeat; height: 178px; margin-top: 0px;margin-left:0px; margin-bottom: 0px;" & gt ;
& lt ; a4j : form id = "mpform" & gt ;
< br / > < br / > < br / > < br / >
& lt ; h : outputLabel value = "Usuário: " style = "margin-left: 1%;font-size:12px; font-color:#0C1174" /& gt ;
& lt ; h : inputText id = "login" style = "margin-left:3%; width :137px; " required = "true" value = "#{pessoaMB.pessoa.email}" /& gt ;
< br / >
& lt ; rich : message for = "login" style = "margin-left:16% ;" & gt ;
& lt ; f : facet name = "errorMarker" & gt ;
& lt ; h : graphicImage url = "../images/menu/erro.png" /& gt ;
& lt ; / f : facet & gt ;
& lt ; / rich : message & gt ;
< br / >
& lt ; h : outputLabel value = "Senha: " style = "margin-left: 1%;font-size:12px;font-color:#0C1174" /& gt ;
& lt ; h : inputSecret id = "senha" style = "margin-left:6%; width :137px; " required = "true" value = "#{pessoaMB.pessoa.senha}" /& gt ;
< br / >
& lt ; rich : message for = "senha" style = "margin-left:16% ;" & gt ;
& lt ; f : facet name = "errorMarker" & gt ;
& lt ; h : graphicImage url = "../images/menu/erro.png" /& gt ;
& lt ; / f : facet & gt ;
& lt ; / rich : message & gt ;
< br / >
& lt ; a4j : commandButton style = "margin-left: 17%; font-size:12px;" value = "Logar" action = "#{pessoaMB.login}" /& gt ;
< br / >
& lt ; / a4j : form & gt ;
& lt ; / div & gt ;
& lt ; / rich : modalPanel & gt ;
& lt ; rich : panelMenuItem label = "Logar" onclick = "javascript:Richfaces.showModalPanel('mp')" & gt ;
& lt ; a4j : support event = "onclick" onsubmit = "true" /& gt ;
& lt ; / rich : panelMenuItem & gt ;
& lt ; / h : form & gt ;
& lt ; / f : view & gt ;
& lt ; / body & gt ;
& lt ; / html & gt ;
igson_mendes_da_silv 4 de jan. de 2008
Nosa que bom que vc consegui …