Rodrigo_Sasaki 7 de dez. de 2012
Você pode abrir um popup modal com aqueles gifs de carregando no onclick, e no oncomplete o fecha.
Valeio_Bezerra 7 de dez. de 2012
<h:selectBooleanCheckbox id="id" value="#{especificacao.selecionado}" update="id" onClick="bean.metodo" onComplete="bean.outrometodo" disabled="bean.atributo"/>
aí nos seus metodos vc muda o atributo pra true ou false.
moacirjava 7 de dez. de 2012
Seguindo a idéia dos nossos amigos Rodrigo Sasaki e Valeio Bezerra você pode fazer uma “telinha” modal que bloqueia o usuário de clicar em qualquer lugar da tela.
Para isso você cria um modal
& lt ; ! DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" & gt ;
& lt ; ui : composition xmlns = "http://www.w3.org/1999/xhtml"
xmlns : s = "http://jboss.com/products/seam/taglib"
xmlns : ui = "http://java.sun.com/jsf/facelets"
xmlns : f = "http://java.sun.com/jsf/core"
xmlns : h = "http://java.sun.com/jsf/html"
xmlns : rich = "http://richfaces.org/rich"
xmlns : a4j = "http://richfaces.org/a4j"
xmlns : tst = "http://seam.tst.jus.br" & gt ;
& lt ; !-- Mensagem de aguardando requisição --& gt ;
& lt ; a4j : status id = "aguarde" for = "areaSalvar"
onstart = "#{rich:component('modalAguardando')}.show()"
onstop = "#{rich:component('modalAguardando')}.hide()" /& gt ;
& lt ; rich : modalPanel id = "modalAguardando" autosized = "true" width = "200" & gt ;
& lt ; h : panelGrid columns = "2" & gt ;
& lt ; h : graphicImage value = "/img/loading.gif" /& gt ;
& lt ; h : outputText value = "Aguarde..." /& gt ;
& lt ; / h : panelGrid & gt ;
& lt ; / rich : modalPanel & gt ;
& lt ; / ui : composition & gt ;
Na sua tela você dá um include nesse modal
& lt ; a4j : region id = "areaSalvar" & gt ;
& lt ; ui : include src = "../modalAguarde.xhtml" /& gt ;
...
& lt ; / a4j : region & gt ;
E no seu componente você configura
& lt ; h : selectBooleanCheckbox id = "id" value = "#{especificacao.selecionado}" update = "id" onClick = "bean.metodo" status = "aguarde" /& gt ;
evandro_araujo 7 de dez. de 2012
Criei um pequeno projeto
e esta dando o seguinte erro :
Function ‘rich:component’ not found, como eu posso incluir essa funcao ??
///////////////////////////////////////checkbox.xhtml
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns= "http://www.w3.org/1999/xhtml"
xmlns:s= "http://jboss.com/products/seam/taglib"
xmlns:ui= "http://java.sun.com/jsf/facelets"
xmlns:f= "http://java.sun.com/jsf/core"
xmlns:h= "http://java.sun.com/jsf/html"
xmlns:rich= "http://richfaces.org/rich"
xmlns:a4j= "http://richfaces.org/a4j"
xmlns:tst= "http://seam.tst.jus.br" >
<a4j:status id= "aguarde" for= "areaSalvar"
onstart= "#{rich:component('modalAguardando')}.show()"
onstop= "#{rich:component('modalAguardando')}.hide()" />
<rich:modalPanel id= "modalAguardando" autosized= "true" width= "200" >
<h:panelGrid columns= "2" >
<h:outputText value= "Aguarde..." />
</h:panelGrid>
</rich:modalPanel>
</ui:composition>
///////////////////////////////////////////////////////////////////index.xhtml
<!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:h= "http://java.sun.com/jsf/html"
xmlns:f= "http://java.sun.com/jsf/core"
xmlns:a4j= "http://richfaces.org/a4j"
xmlns:ui= "http://java.sun.com/jsf/facelets" >
<h:head><title> Minha Aplicação</title></h:head>
<h:body>
<h:form>
<a4j:region id= "areaSalvar" >
<ui:include src= "checkbox.xhtml" />
</a4j:region>
<h:selectBooleanCheckbox value= "#{especificacao.selecionado}" >
<a4j:support event= "onclick" ajaxSingle= "true"
action= "#{ManterItemOrcamentoMB.selecionarEspecificacao}"
reRender= "panelEspecificacoes, panelAnalises,
totalEnsaiosContratados, panelPerguntas, panelTotal" />
</h:selectBooleanCheckbox>
Estou tentando executar o Jboss e estsa dando o erro abaixo :
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Function ‘rich:component’ not found
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
root cause
javax . el . ELException : Function ‘ rich : component ’ not found
org . apache . el . lang . ExpressionBuilder . visit ( ExpressionBuilder . java : 210 )
org . apache . el . parser . SimpleNode . accept ( SimpleNode . java : 147 )
org . apache . el . lang . ExpressionBuilder . prepare ( ExpressionBuilder . java : 167 )
org . apache . el . lang . ExpressionBuilder . build ( ExpressionBuilder . java : 185 )
org . apache . el . lang . ExpressionBuilder . createValueExpression ( ExpressionBuilder . java : 229 )
org . apache . el . ExpressionFactoryImpl . createValueExpression ( ExpressionFactoryImpl . java : 67 )
com . sun . faces . facelets . el . ELText $ ELTextVariable . apply ( ELText . java : 203 )
com . sun . faces . facelets . el . ELText $ ELTextComposite . apply ( ELText . java : 184 )
com . sun . faces . facelets . compiler . AttributeInstruction . apply ( AttributeInstruction . java : 101 )
com . sun . faces . facelets . compiler . UIInstructionHandler . apply ( UIInstructionHandler . java : 141 )
javax . faces . view . facelets . CompositeFaceletHandler . apply ( CompositeFaceletHandler . java : 98 )
com . sun . faces . facelets . tag . ui . CompositionHandler . apply ( CompositionHandler . java : 166 )
com . sun . faces . facelets . compiler . NamespaceHandler . apply ( NamespaceHandler . java : 93 )
com . sun . faces . facelets . compiler . EncodingHandler . apply ( EncodingHandler . java : 86 )
com . sun . faces . facelets . impl . DefaultFacelet . include ( DefaultFacelet . java : 308 )
com . sun . faces . facelets . impl . DefaultFacelet . include ( DefaultFacelet . java : 367 )
com . sun . faces . facelets . impl . DefaultFacelet . include ( DefaultFacelet . java : 346 )
com . sun . faces . facelets . impl . DefaultFaceletContext . includeFacelet ( DefaultFaceletContext . java : 199 )
com . sun . faces . facelets . tag . ui . IncludeHandler . apply ( IncludeHandler . java : 147 )
javax . faces . view . facelets . CompositeFaceletHandler . apply ( CompositeFaceletHandler . java : 98 )
javax . faces . view . facelets . DelegatingMetaTagHandler . applyNextHandler ( DelegatingMetaTagHandler . java : 137 )
com . sun . faces . facelets . tag . jsf . ComponentTagHandlerDelegateImpl . apply ( ComponentTagHandlerDelegateImpl . java : 195 )
javax . faces . view . facelets . DelegatingMetaTagHandler . apply ( DelegatingMetaTagHandler . java : 120 )
javax . faces . view . facelets . CompositeFaceletHandler . apply ( CompositeFaceletHandler . java : 98 )
javax . faces . view . facelets . DelegatingMetaTagHandler . applyNextHandler ( DelegatingMetaTagHandler . java : 137 )
com . sun . faces . facelets . tag . jsf . ComponentTagHandlerDelegateImpl . apply ( ComponentTagHandlerDelegateImpl . java : 195 )
javax . faces . view . facelets . DelegatingMetaTagHandler . apply ( DelegatingMetaTagHandler . java : 120 )
javax . faces . view . facelets . CompositeFaceletHandler . apply ( CompositeFaceletHandler . java : 98 )
com . sun . faces . facelets . compiler . NamespaceHandler . apply ( NamespaceHandler . java : 93 )
javax . faces . view . facelets . CompositeFaceletHandler . apply ( CompositeFaceletHandler . java : 98 )
com . sun . faces . facelets . compiler . EncodingHandler . apply ( EncodingHandler . java : 86 )
com . sun . faces . facelets . impl . DefaultFacelet . apply ( DefaultFacelet . java : 152 )
com . sun . faces . application . view . FaceletViewHandlingStrategy . buildView ( FaceletViewHandlingStrategy . java : 774 )
com . sun . faces . lifecycle . RenderResponsePhase . execute ( RenderResponsePhase . java : 100 )
com . sun . faces . lifecycle . Phase . doPhase ( Phase . java : 101 )
com . sun . faces . lifecycle . LifecycleImpl . render ( LifecycleImpl . java : 139 )
javax . faces . webapp . FacesServlet . service ( FacesServlet . java : 594 )
evandro_araujo 7 de dez. de 2012
Pessoal ,
Tenho a tela em anexo, onde tenho varios checkbox, quando clico em um item dependendo da quantidade de informações aparece a tela CARREGANDO, e teoricamente o usuario só poderá escolher outro checkbox, assim que sumir a tela carregando .
Porem na tela enquanto esta a mensagem CARREGANDO, o usuário pode clicar em outro checkbox, provocando erro de sistema.
Pensei em quando o usuario clicar em um checkbox, e logo em seguida bloquear todos os checkbox e só ira habilitar somente quando terminar o processo
é a melhor forma ou alguem tem outra sugestão
evandro_araujo 10 de dez. de 2012
Pessoal, alguem pode me ajudar ??
moacirjava 10 de dez. de 2012
Esse erro do “rich:component” é porque isso é um código da biblioteca do RichFaces.