Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3777

visibility of NavigationToolbar is based on the previous filter state

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC4
    • Fix Version/s: 1.5-RC5
    • Component/s: wicket-extensions
    • Labels:
      None
    • Environment:
      Ubuntu 11.04; Netbeans 7; Glassfish 3.1; sun-java6-jdk

      Description

      I'm using a FilterForm with a DataTable and a NavigationToolbar.

      The NavigationToolbar is supposed to be hidden when the DataTable has 0 or 1 pages of results. So, when a filter is applied that results in 1 or 0 pages of results, the NavigationToolbar should disappear.

      In reality, it gets hidden on the first request after the one in which the filter was set, and it reappears on the first request after the one in which the filter is removed.

      I think this has to do with the fact that NavigationToolbar.onConfigure() is being called before the FilterForm.onSubmit , but i'm not sure.

      Please see the attached quickstart. Instructions on how to reproduce the problem are on the quickstart's homepage.

      Stacktrace from NavigationToolbar.onConfigure(): (HomePage$2 = my anonymous subclass of NavigationToolbar that logs the onConfigure event):

      SEVERE: java.lang.Exception: Stack trace
      at java.lang.Thread.dumpStack(Thread.java:1249)
      at nl.seeas.datatablebug.HomePage$2.onConfigure(HomePage.java:46)
      at org.apache.wicket.Component.configure(Component.java:1163)
      at org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable$ToolbarsContainer$1.component(DataTable.java:440)
      at org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable$ToolbarsContainer$1.component(DataTable.java:438)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:146)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:122)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:194)
      at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:890)
      at org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable$ToolbarsContainer.isVisible(DataTable.java:436)
      at org.apache.wicket.Component.determineVisibility(Component.java:4342)
      at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2168)
      at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2162)
      at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2162)
      at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2162)
      at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2162)
      at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2162)
      at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2162)
      at org.apache.wicket.markup.html.form.Form$11.component(Form.java:1221)
      at org.apache.wicket.markup.html.form.Form$11.component(Form.java:1207)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:146)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:164)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:164)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:164)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:164)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:164)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:164)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:164)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:122)
      at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:875)
      at org.apache.wicket.markup.html.form.Form.isMultiPart(Form.java:1204)
      at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1255)
      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:703)
      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:684)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
      at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:218)
      at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:171)
      at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:157)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:718)
      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662)

        Attachments

        1. datatablebug.zip
          22 kB
          Sander Plas

          Activity

            People

            • Assignee:
              ivaynberg Igor Vaynberg
              Reporter:
              oele Sander Plas
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: