FilterPane Plugin
  1. FilterPane Plugin
  2. GPFILTERPANE-87

Using direct link to filter action causes the currentCritera tag to throw exception

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Grails-FilterPane 2.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 11.04, SpringSource STS

      Description

      I use a direct link to a filter action in one of my views. The link uses <g:link> but it produces a link to the filter action like this:
      http://localhost:8080/billing-web/book/filter?sort=&order=&filter.op.author.id=Equal&filter.author.id=2
      (I actually created some tags that produces the correct links, see http://jira.grails.org/browse/GPFILTERPANE-35)

      I find this really powerful since I can create a link from the "author" page that goes directly to a page where the correct "books" are sorted out.

      In 2.0 of the filterpane plugin, this causes the currentCriteria tag in the list view to crash with the exception described below if it is used directly after startup of the server. Once the list action of the BookController has been used once, the link works as expected after that. In 0.7 version of the plugin this worked as expected.

      Exception:
      ERROR [web.errors.GrailsExceptionResolver] Exception occurred when processing request: [GET] /billing-web/book/filter - parameters:
      sort:
      order:
      filter.productionReport.id: 2
      filter.op.productionReport.id: Equal
      Stacktrace follows:
      org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag <filterpane:currentCriteria>: No such property: filterPaneFieldNamePrefix for class: org.codehaus.groovy.grails.commons.DefaultGrailsDomainClassProperty at /home/myname/workspace/bookstore-web/grails-app/views/book/list.gsp:19
      at java.lang.Thread.run(Thread.java:662)
      Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <filterpane:currentCriteria>: No such property: filterPaneFieldNamePrefix for class: org.codehaus.groovy.grails.commons.DefaultGrailsDomainClassProperty at /home/myname/workspace/bookstore-web/grails-app/views/book/list.gsp:19
      at home_stejon0_workspace_billing_billing_web_grails_app_views_book_list_gsp$_run_closure2.doCall(list.gsp:19)
      at home_stejon0_workspace_billing_billing_web_grails_app_views_book_list_gsp$_run_closure2.doCall(list.gsp)
      at home_stejon0_workspace_billing_billing_web_grails_app_views_book_list_gsp.run(list.gsp:67)
      ... 1 more
      Caused by: groovy.lang.MissingPropertyException: No such property: filterPaneFieldNamePrefix for class: org.codehaus.groovy.grails.commons.DefaultGrailsDomainClassProperty
      at org.grails.plugin.filterpane.FilterPaneTagLib.resolveFieldName(FilterPaneTagLib.groovy:676)
      at org.grails.plugin.filterpane.FilterPaneTagLib.this$2$resolveFieldName(FilterPaneTagLib.groovy)
      at org.grails.plugin.filterpane.FilterPaneTagLib$_closure6_closure17.doCall(FilterPaneTagLib.groovy:238)
      at org.grails.plugin.filterpane.FilterPaneTagLib$_closure6.doCall(FilterPaneTagLib.groovy:168)
      ... 4 more

        Activity

        Hide
        Leonid Vysochyn added a comment -

        Having the same issue. Is there any workaround or something?

        Show
        Leonid Vysochyn added a comment - Having the same issue. Is there any workaround or something?
        Hide
        Leonid Vysochyn added a comment -

        I found that in my case it worked when I moved <filterpane:filterPane> tag to be above filterpane:currentCriteria tag in gsp markup.

        By the way in my use case I do not create links but just loading the default saved filter parameters for a user from database and then forwarding them to the filter action. After the server startup the page with filterpane failed to display because of the above exception. But after I had moved filterpane tag it started to work as expected. I have not seen this issue in previous versions of filterpane.

        Show
        Leonid Vysochyn added a comment - I found that in my case it worked when I moved <filterpane:filterPane> tag to be above filterpane:currentCriteria tag in gsp markup. By the way in my use case I do not create links but just loading the default saved filter parameters for a user from database and then forwarding them to the filter action. After the server startup the page with filterpane failed to display because of the above exception. But after I had moved filterpane tag it started to work as expected. I have not seen this issue in previous versions of filterpane.
        Hide
        Jonas Stenberg added a comment -

        Great! This works for me too. Thanks.
        I also found that the property that I use to filter upon needs to be within the associatedProperties, it doesn't work if I put it in the additionalProperties.

        Show
        Jonas Stenberg added a comment - Great! This works for me too. Thanks. I also found that the property that I use to filter upon needs to be within the associatedProperties, it doesn't work if I put it in the additionalProperties.

          People

          • Assignee:
            Steve Krenek
            Reporter:
            Jonas Stenberg
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: