DisplayTag
  1. DisplayTag
  2. DISPL-192

add row style to current row from TableDecorator

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Component/s: Build/distribution
    • Labels:
      None
    • Application server:
      any

      Description

      Add a call back method on TableDecorator called addRowStyle(). This allows a row style to be added based on inspection of data for the current row.

        Activity

        Hide
        Justin James added a comment -
        Feature request implementation patch.
        Show
        Justin James added a comment - Feature request implementation patch.
        Hide
        Justin James added a comment -
        Used incorrect component. Component should be HTML generation
        Show
        Justin James added a comment - Used incorrect component. Component should be HTML generation
        Hide
        added a comment -
        I have applied the patch and it seems to be working correctly, but if I'm not wrong it throws a NullPointerException if you haven't declared a decorator for the table. I have traced the error back to the Row class. This sentence on line 151 is causing the exception:
                     addStyle = this.tableModel.getTableDecorator().addRowClass();

        Prepending this line with a null check for tableModel.getTableDecorator() corrects the bug.
        Show
        added a comment - I have applied the patch and it seems to be working correctly, but if I'm not wrong it throws a NullPointerException if you haven't declared a decorator for the table. I have traced the error back to the Row class. This sentence on line 151 is causing the exception:              addStyle = this.tableModel.getTableDecorator().addRowClass(); Prepending this line with a null check for tableModel.getTableDecorator() corrects the bug.
        Hide
        Jonathan A Harper added a comment -
        A setRowId() method for TableDecorator would be very useful as well.
        Show
        Jonathan A Harper added a comment - A setRowId() method for TableDecorator would be very useful as well.
        Hide
        added a comment -
        thanks for the patch... just what i was looking for.
        Show
        added a comment - thanks for the patch... just what i was looking for.
        Hide
        Matt Raible added a comment -
        I tried committing this patch, but it causes all the tests to fail:

        Testcase: org.displaytag.jsptests.AutocolumnStringTest.test11 (autocolumns-string.jsp)(org.displaytag.jsptests.AutocolumnStringTest): Caused an ERROR
        null
        java.lang.NullPointerException
        at org.displaytag.model.Row.getOpenTag(Row.java:151)

        Line 151 is:

        String addStyle = this.tableModel.getTableDecorator().addRowClass();
        Show
        Matt Raible added a comment - I tried committing this patch, but it causes all the tests to fail: Testcase: org.displaytag.jsptests.AutocolumnStringTest.test11 (autocolumns-string.jsp)(org.displaytag.jsptests.AutocolumnStringTest): Caused an ERROR null java.lang.NullPointerException at org.displaytag.model.Row.getOpenTag(Row.java:151) Line 151 is: String addStyle = this.tableModel.getTableDecorator().addRowClass();
        Hide
        fabrizio giustina added a comment -
        patch committed. dummy test case added, will close the issue only when the test case will be working
        Show
        fabrizio giustina added a comment - patch committed. dummy test case added, will close the issue only when the test case will be working
        Hide
        fabrizio giustina added a comment -
        testcase added and working, closing
        (CVS for 1.1)
        Show
        fabrizio giustina added a comment - testcase added and working, closing (CVS for 1.1)

          People

          • Reporter:
            Justin James
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 hour
              1h
              Remaining:
              Remaining Estimate - 1 hour
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified