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

Change BaseWicketTester.getTagByXXX return value from TagTester to TagTester[]

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0-rc1
    • 1.4-RC2
    • wicket
    • None

    Description

      When using the org.apache.wicket.markup.repeater.data.DataView, each row in the table has the same wicket:id. I am trying to use the TagTester to ensure that each <tr> tag has the correct attributes, in this case class="odd" and class="even". Since getTagByWicketId and getTagById only return a single TagTester, a tester for the same markup tag is returned each time, making it impossible to test any row other than the first.

      Example HTML output:

      <table>
      <tr class="even" wicket:id="table"> <--------- TagTester returned is always for this tag
      </tr>
      <tr class="odd" wicket:id="table">
      </tr>
      <tr class="even" wicket:id="table">
      </tr>
      <tr class="odd" wicket:id="table">
      </tr>
      <tr class="even" wicket:id="table">
      </tr>
      </table>

      Proposed solution: change the return value to TagTester[] so that one call will return all of the tags with that wicket:id

      Attachments

        1. MultipleTagTester.java
          4 kB
          Craig McIlwee

        Activity

          People

            jdonnerstag Juegen Donnerstag
            falcor Craig McIlwee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: