ICEfaces
  1. ICEfaces
  2. ICE-8871

ice:dataPaginator - IllegalArgumentException thrown when using paginator in a portlet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: EE-3.0.0.GA_P01, 3.2
    • Fix Version/s: 4.0.BETA, 4.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Liferay 6.0.6 - Tomcat 6.0.29, Liferay Faces Bridge 3.0.0
    • Assignee Priority:
      P2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      As per http://issues.liferay.com/browse/FACES-1482 there are a few potential workarounds for this problem:

      1) Use one of the following composite component tags, found in the Liferay Faces Portal dependency:
      - liferay-ui:ice-info-data-paginator
      - liferay-ui:ice-nav-data-paginator
      - liferay-ui:ice-page-iterator

      3) If possible, upgrade to use the ace:dataTable component that has a built-in paginator and works well with the latest version of the LiferayFaces Bridge.

      2) Force the component to evaluate expressions instead of binding them as literals by modifying the attribute values to look like this:
       
      <ice:dataPaginator id="paginator"
                                  fastStep="${2}"
                                  for="carTable"
                                  paginator="${true}"
                                  paginatorMaxPages="${3}">
      Show
      As per http://issues.liferay.com/browse/FACES-1482 there are a few potential workarounds for this problem: 1) Use one of the following composite component tags, found in the Liferay Faces Portal dependency: - liferay-ui:ice-info-data-paginator - liferay-ui:ice-nav-data-paginator - liferay-ui:ice-page-iterator 3) If possible, upgrade to use the ace:dataTable component that has a built-in paginator and works well with the latest version of the LiferayFaces Bridge. 2) Force the component to evaluate expressions instead of binding them as literals by modifying the attribute values to look like this:   <ice:dataPaginator id="paginator"                             fastStep="${2}"                             for="carTable"                             paginator="${true}"                             paginatorMaxPages="${3}">

      Description

      When an ice:dataPaginator is used in a Liferay portley an IllegalArgumentException is thrown. Sample of stack trace:

      java.lang.IllegalArgumentException: argument type mismatch
              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 javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:2399)
              at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:2283)
              at com.sun.faces.facelets.tag.jsf.ComponentRule$LiteralAttributeMetadata.applyMetadata(ComponentRule.java:87)
              at com.sun.faces.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:81)
              at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:129)
              at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:102)

      Removing the paginator the page renders fine. This also works fine in a non-portlet environment.

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that shows issue.

        Show
        Arran Mccullough added a comment - Attached test case that shows issue.
        Hide
        Deryk Sinotte added a comment -

        So I ran the test and can see the reported issue. Rather than remove the entire datapaginator component, I removed some of it's attributes. So given this to start:

                    <ice:dataPaginator for="testTable" 
                                       id="myPaginator"
                                       fastStep="2"
                                       paginator="true"
                                       paginatorMaxPages="3">
        

        If I then remove the last 3 attributes:

                    <ice:dataPaginator for="testTable" 
                                       id="myPaginator">
        

        However removing one attribute at a time doesn't help. If any of those 3 attributes are provided, the same problem occurs. So it looks like the component is having a decoding problem of some kind. Since the 3 that I removed are actually Strings (but ints and boolean), it may be related to an issue with the type it's expecting. I'll have to try one of our own compat portlet examples to see if the same issue exists there.

        Show
        Deryk Sinotte added a comment - So I ran the test and can see the reported issue. Rather than remove the entire datapaginator component, I removed some of it's attributes. So given this to start: <ice:dataPaginator for = "testTable" id= "myPaginator" fastStep= "2" paginator= " true " paginatorMaxPages= "3" > If I then remove the last 3 attributes: <ice:dataPaginator for = "testTable" id= "myPaginator" > However removing one attribute at a time doesn't help. If any of those 3 attributes are provided, the same problem occurs. So it looks like the component is having a decoding problem of some kind. Since the 3 that I removed are actually Strings (but ints and boolean), it may be related to an issue with the type it's expecting. I'll have to try one of our own compat portlet examples to see if the same issue exists there.
        Hide
        Deryk Sinotte added a comment -

        So this appears to be a problem with the LiferayFaces Bridge. I've discussed this with the developer and he is going to take a look at it. I'll link to the issue in the Liferay system when it's available.

        It turns out that the bridge has some fixes for ICE-6398 that directly impact the ice:dataPaginator component. During our discussion, we tried running one of Liferay's working sample portlets that uses the ice:dataPaginator ( http://www.liferay.com/community/liferay-projects/liferay-faces/demos#icefaces3-directory-portlet). In addition to code changes that impact the component, Liferay also provides a composite component tag for using the paginator. You can see how this is done by downloading and looking at the code in the linked example. The heart of the matter can be found in the directory.xhtml file:

        <liferay-ui:ice-page-iterator for="users"/>

        Using the composite component, you can also add the desired attributes without causing the problem:

        <liferay-ui:ice-page-iterator for="users" paginator="true" fastStep="2" paginatorMaxPages="3"/>

        If you switch the example to use an ice:dataPaginator directly, the problem manifests:

        <ice:dataPaginator for="users" paginator="true" fastStep="2" paginatorMaxPages="3"/>

        So while Liferay looks to fix the problem in the bridge, a valid workaround would be to use the composite component provided by Liferay. This basically means adding the LiferayFaces Portal library (https://www.liferay.com/community/liferay-projects/liferay-faces/portal) to the project and changing the paginator markup to what I've noted above.

        Show
        Deryk Sinotte added a comment - So this appears to be a problem with the LiferayFaces Bridge. I've discussed this with the developer and he is going to take a look at it. I'll link to the issue in the Liferay system when it's available. It turns out that the bridge has some fixes for ICE-6398 that directly impact the ice:dataPaginator component. During our discussion, we tried running one of Liferay's working sample portlets that uses the ice:dataPaginator ( http://www.liferay.com/community/liferay-projects/liferay-faces/demos#icefaces3-directory-portlet ). In addition to code changes that impact the component, Liferay also provides a composite component tag for using the paginator. You can see how this is done by downloading and looking at the code in the linked example. The heart of the matter can be found in the directory.xhtml file: <liferay-ui:ice-page-iterator for = "users" /> Using the composite component, you can also add the desired attributes without causing the problem: <liferay-ui:ice-page-iterator for = "users" paginator= " true " fastStep= "2" paginatorMaxPages= "3" /> If you switch the example to use an ice:dataPaginator directly, the problem manifests: <ice:dataPaginator for = "users" paginator= " true " fastStep= "2" paginatorMaxPages= "3" /> So while Liferay looks to fix the problem in the bridge, a valid workaround would be to use the composite component provided by Liferay. This basically means adding the LiferayFaces Portal library ( https://www.liferay.com/community/liferay-projects/liferay-faces/portal ) to the project and changing the paginator markup to what I've noted above.
        Hide
        Deryk Sinotte added a comment -

        Corresponding issue in Liferay's tracking system:

        http://issues.liferay.com/browse/FACES-1482

        Show
        Deryk Sinotte added a comment - Corresponding issue in Liferay's tracking system: http://issues.liferay.com/browse/FACES-1482
        Hide
        Deryk Sinotte added a comment -

        Since the issue is likely to be correct in the next LiferayFaces Bridge release and the current workaround provided is reasonable, I'm resolving this as Won't Fix.

        Show
        Deryk Sinotte added a comment - Since the issue is likely to be correct in the next LiferayFaces Bridge release and the current workaround provided is reasonable, I'm resolving this as Won't Fix.
        Hide
        Deryk Sinotte added a comment -

        Mistake. This shouldn't be resolved until we can verify the fix in the LiferayFaces Bridge. Re-opening and lowering priority for now.

        Show
        Deryk Sinotte added a comment - Mistake. This shouldn't be resolved until we can verify the fix in the LiferayFaces Bridge. Re-opening and lowering priority for now.
        Hide
        Deryk Sinotte added a comment -

        Resolving as Won't Fix. The documented workarounds are considered to be sufficient for dealing with the problem.

        Show
        Deryk Sinotte added a comment - Resolving as Won't Fix. The documented workarounds are considered to be sufficient for dealing with the problem.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: