gmmascarin 12 de jul. de 2011
Galera
O problema pode ser resolvido com richFaces da seguinte maneira:
& lt ; rich: modalPanel id = "panelStatus" autosized = "true" & gt ;
& lt ; h: graphicImage url = "/imagens/carregando.gif" style = "border:0px" /& gt ;
& lt ; h: outputText value = "#{msg.principal_carregando}" /& gt ;
& lt ; / rich: modalPanel & gt ;
& lt ; a4j: status id = "statusCarregarModalPanel"
onstart = "Richfaces.showModalPanel('panelStatus');"
onstop = "#{rich:component('panelStatus')}.hide()" /& gt ;
Mais detalhes no link http://luisfelipevs.wordpress.com/2009/06/24/utilizando-o-a4jstatus/ .
Entretanto, como utilizo MyFaces Trinidad, estava tendo problema de compatibilidade com o component do RichFaces (Erro de PPR). Para solucionar o problema deixei o monitoramento do Request com o trinidad e a exibição da imagem .gif (carregando) com o rich:modalPanel, tendo javascript como intermediário.
Segue a solução:
& lt ; script language = "JavaScript" & gt ;
function loader ( state )
{
var busy = state == TrRequestQueue . STATE_BUSY ;
if ( busy ){
Richfaces . showModalPanel ( "painelCarregando" );
} else {
Richfaces . hideModalPanel ( "painelCarregando" );
}
if ( ! busy )
{
TrPage . getInstance () . getRequestQueue ()
. removeStateChangeListener ( loader );
}
}
function addListener (){
var requestQueue = TrPage . getInstance () . getRequestQueue ();
requestQueue . addStateChangeListener ( loader );
}
& lt ; / script & gt ;
& lt ; rich : modalPanel id = "painelCarregando" autosized = "true" & gt ;
& lt ; h : graphicImage url = "/imagens/carregando.gif" style = "border:0px" /& gt ;
& lt ; h : outputText value = "#{msg.principal_carregando}" /& gt ;
& lt ; / rich : modalPanel & gt ;
& lt ; tr : selectOneChoice id = "projeto" required = "true" immediate = "true"
partialTriggers = "colaborador" autoSubmit = "true" contentStyle = "width: 400px"
valueChangeListener = "#{sessionBean.valueChangeListener}"
value = "#{sessionBean.projeto}" label = "#{msg.registrarAtividade_projeto}:" onchange = "addListener();" & gt ;
& lt ; t : selectItems value = "#{colaboradorBean.listaProjetosAlocados}"
var = "projeto" itemLabel = "#{projeto.nomeCompleto}" itemValue = "#{projeto}" /& gt ;
& lt ; / tr : selectOneChoice & gt ;
Reparem que addListener() foi chamado no evento onchange da combo. Verifique o evento correspondente do seu component.
Abraços