1. java
  2. android
  3. c#
  4. .net
  5. javascript
  6. php
  7. jquery
  8. html
  9. sql

Bug RichFaces 4.3.5 SortOrder ?

Estou usando a versão 4.3.5 do RichFaces, estou tentando ordenar uma tabela:

<rich:dataScroller for="table" maxPages="10" renderIfSinglePage="false" />
       <rich:dataTable value="#{dadosDoContratoBean.dadosContrato.situacoesContrato}" var="situacaoContrato" id="table" rows="10" rowClasses="odd-row, even-row"> 

            <rich:column sortBy="#{situacaoContrato.situacaoContrato}" sortOrder="ASCENDING">
                <f:facet name="header">
                    <h:outputText value="Situação"/>
                </f:facet>
                <h:outputText value="#{situacaoContrato.situacaoContrato}"/>
            </rich:column>

        </rich:dataTable>
<rich:dataScroller for="table" maxPages="10"  />

Porém quando tento executar a ordenação, encontro o seguinte erro:

Cannot convert ASCENDING of type class java.lang.String to class org.richfaces.component.SortOrder
09:01:18,682 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/sigin].[Faces Servlet]] (http-/0.0.0.0:8080-3) JBWEB000236: Servlet.service() for servlet Faces Servlet threw exception: javax.el.ELException: JBWEB006003: Cannot convert ASCENDING of type class java.lang.String to class org.richfaces.component.SortOrder
    at org.apache.el.lang.ELSupport.coerceToEnum(ELSupport.java:181) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:390) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:49) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at com.sun.faces.facelets.tag.BeanPropertyTagRule$LiteralPropertyMetadata.applyMetadata(BeanPropertyTagRule.java:88) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:81) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:129) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:102) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.setAttributes(BehaviorsAddingComponentHandlerWrapper.java:113) [richfaces-components-ui-4.3.5.Final.jar:4.3.5.Final]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.doNewComponentActions(ComponentTagHandlerDelegateImpl.java:408) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:171) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53) [richfaces-components-ui-4.3.5.Final.jar:4.3.5.Final]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53) [richfaces-components-ui-4.3.5.Final.jar:4.3.5.Final]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53) [richfaces-components-ui-4.3.5.Final.jar:4.3.5.Final]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53) [richfaces-components-ui-4.3.5.Final.jar:4.3.5.Final]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53) [richfaces-components-ui-4.3.5.Final.jar:4.3.5.Final]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:106) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:111) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53) [richfaces-components-ui-4.3.5.Final.jar:4.3.5.Final]
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:164) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:914) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:420) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

Tentei seguir esse exemplo que diz que essa implementação está disponível desde a versão 3.0.0 do RichFaces:

Figure 6.18. with "sortOrder" attribute

Alguém sabe como posso efetuar essa ordenação ?

Desde já agradeço !

  1. Você vai ver essas setas em qualquer página de pergunta. Com elas, você pode dizer se uma pergunta ou uma resposta foram relevantes ou não.
  2. Edite sua pergunta ou resposta caso queira alterar ou adicionar detalhes.
  3. Caso haja alguma dúvida sobre a pergunta, adicione um comentário. O espaço de respostas deve ser utilizado apenas para responder a pergunta.
  4. Se o autor da pergunta marcar uma resposta como solucionada, esta marca aparecerá.
  5. Clique aqui para mais detalhes sobre o funcionamento do GUJ!

1 resposta

Não é a resposta que estava procurando? Procure outras perguntas com as tags java jsf richfaces ou faça a sua própria pergunta.