Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-14275

dataScroller: JS API: invoking fastRewind/fastForward throws NumberFormatException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.5.16
    • Fix Version/s: 4.5.17
    • Component/s: None
    • Labels:
    • Steps to Reproduce:
      Hide

      Reproducible in Metamer:

      1. deploy Metamer and open http://localhost:8080/metamer/faces/components/richDataScroller/simple.xhtml
      2. click on the button <<< fast rewind under Using componentControl + operation
      3. on the server side you'll get:
        javax.faces.FacesException: javax.faces.FacesException: For input string: "fastrewind"
        	at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:273)
        	at org.richfaces.context.ExtendedPartialViewContext.processPartial(ExtendedPartialViewContext.java:264)
        	at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927)
        	at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
        	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
        	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:654)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.richfaces.tests.metamer.TestIdentityFilter.doFilter(TestIdentityFilter.java:95)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
        	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
        	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
        	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
        	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
        	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
        	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
        	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        	at java.lang.Thread.run(Thread.java:745)
        Caused by: javax.faces.FacesException: For input string: "fastrewind"
        	at org.richfaces.component.AbstractDataScroller.getPageForFacet(AbstractDataScroller.java:249)
        	at org.richfaces.renderkit.DataScrollerBaseRenderer.doDecode(DataScrollerBaseRenderer.java:65)
        	at org.richfaces.renderkit.RendererBase.decode(RendererBase.java:81)
        	at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831)
        	at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1226)
        	at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:573)
        	at org.richfaces.context.MetaComponentProcessingVisitCallback.visit(MetaComponentProcessingVisitCallback.java:73)
        	at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:103)
        	at org.richfaces.context.ExtendedExecuteVisitContext.invokeVisitCallback(ExtendedExecuteVisitContext.java:55)
        	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1689)
        	at org.richfaces.component.UIDataAdaptor.visitComponents(UIDataAdaptor.java:1267)
        	at org.richfaces.component.UIDataAdaptor.visitFixedChildren(UIDataAdaptor.java:1277)
        	at org.richfaces.component.UIDataTableBase.visitFixedChildren(UIDataTableBase.java:327)
        	at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1343)
        	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
        	at javax.faces.component.UIForm.visitTree(UIForm.java:371)
        	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
        	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
        	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
        	at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:403)
        	at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:266)
        	... 33 more
        Caused by: java.lang.NumberFormatException: For input string: "fastrewind"
        	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        	at java.lang.Integer.parseInt(Integer.java:580)
        	at java.lang.Integer.parseInt(Integer.java:615)
        	at org.richfaces.component.AbstractDataScroller.getPageForFacet(AbstractDataScroller.java:247)
        	... 53 more
         
      Show
      Reproducible in Metamer: deploy Metamer and open http://localhost:8080/metamer/faces/components/richDataScroller/simple.xhtml click on the button <<< fast rewind under Using componentControl + operation on the server side you'll get: javax.faces.FacesException: javax.faces.FacesException: For input string: "fastrewind" at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:273) at org.richfaces.context.ExtendedPartialViewContext.processPartial(ExtendedPartialViewContext.java:264) at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927) at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:654) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.richfaces.tests.metamer.TestIdentityFilter.doFilter(TestIdentityFilter.java:95) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang. Thread .run( Thread .java:745) Caused by: javax.faces.FacesException: For input string: "fastrewind" at org.richfaces.component.AbstractDataScroller.getPageForFacet(AbstractDataScroller.java:249) at org.richfaces.renderkit.DataScrollerBaseRenderer.doDecode(DataScrollerBaseRenderer.java:65) at org.richfaces.renderkit.RendererBase.decode(RendererBase.java:81) at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831) at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1226) at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:573) at org.richfaces.context.MetaComponentProcessingVisitCallback.visit(MetaComponentProcessingVisitCallback.java:73) at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:103) at org.richfaces.context.ExtendedExecuteVisitContext.invokeVisitCallback(ExtendedExecuteVisitContext.java:55) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1689) at org.richfaces.component.UIDataAdaptor.visitComponents(UIDataAdaptor.java:1267) at org.richfaces.component.UIDataAdaptor.visitFixedChildren(UIDataAdaptor.java:1277) at org.richfaces.component.UIDataTableBase.visitFixedChildren(UIDataTableBase.java:327) at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1343) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at javax.faces.component.UIForm.visitTree(UIForm.java:371) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:403) at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:266) ... 33 more Caused by: java.lang.NumberFormatException: For input string: "fastrewind" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang. Integer .parseInt( Integer .java:580) at java.lang. Integer .parseInt( Integer .java:615) at org.richfaces.component.AbstractDataScroller.getPageForFacet(AbstractDataScroller.java:247) ... 53 more

      Description

      Using button invoking JS API function of dataScroller like following:

      <h:commandButton value="fast forward »»">
          <rich:componentControl event="click" target="scroller" operation="fastForward" />
      </h:commandButton>
      

      will lead to java.lang.NumberFormatException on the server side.

      This one is however working:

      <h:commandButton value="fast forward »»">
          <rich:componentControl event="click" target="scroller" operation="switchToPage">
              <f:param value="fastForward" />
          </rich:componentControl>
      </h:commandButton>
      

      The problem is, that a lowercase value is passed to method in AbstractDataScroller getPageForFacet(String facetName), when using the first approach.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                michpetrov Michal Petrov
                Reporter:
                jstefek Jiří Štefek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: