Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3034

ui:repeat offset and size performs incorrect validation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.3
    • 2.0.8, 2.1.2
    • General
    • None
    • OpenJDK 1.6.0_20; Tomcat 6.0.20; Ubuntu 10.04 on kernel version 2.6.32-28-generic

    Description

      The following ui:repeat tag with those values of size and offset throw a FacesException with the message: "iteration offset cannot be greater than collection size."

      <ui:repeat var="listing" value="#

      {myListings.listings}

      " size="19" offset="20">

      It appears that the method _validateAttributes() in the UIRepeat class performs the validation incorrectly. It seems to assume that the value of size is the size of the collection, rather than the desired iteration size. Here is the relevant code from _validateAttributes():

      if ((size > -1) && (begin > size))

      { throw new FacesException ("iteration offset cannot be greater " + "than collection size"); }

      The exception is thrown in the above case because begin > size, where begin = offset = 20.

      Attachments

        Issue Links

          Activity

            People

              lu4242 Leonardo Uribe
              reydal Rey Dalisay
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: