DisplayTag
  1. DisplayTag
  2. DISPL-58

Additional attribute for specifying property used for sorting.

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 RC2
    • Fix Version/s: 1.0 RC2
    • Component/s: Paging/Sorting
    • Labels:
      None
    • Application server:
      Tomcat 5.0.28

      Description

      As per my email to the list:

      ------------------------------------------------------
      This is sorta a follow-up to my last post. I had a
      issue where I was filling in a javascript link with my
      column property value and when sorting on that column
      header, the sort would not work correctly as it was
      always using the tag value (incl the javascript href)
      that i specified.

      So in other words, I wanted to sort by my original
      bean value and not my later decorated value.

      After digging around in the source, I added a extra
      property to the column tag that allows me to set the
      original bean property name in addition to the table
      decorator property. I Also made the additional changes
      to the underlying dependency classes and now my sort
      and decorator value can co-exist and work properly.
      ------------------------------------------------------

      I have the fixes but I'm not sure how to upload them nor create patches.

        Issue Links

          Activity

          Hide
          Jason Lee added a comment -
          Ah, I found out how to upload files. However, I still don't know how to create the necessary patches. Sorry.
          Show
          Jason Lee added a comment - Ah, I found out how to upload files. However, I still don't know how to create the necessary patches. Sorry.
          Hide
          fabrizio giustina added a comment -
          committed to cvs
          added a sortProperty attribute to column tag.
          Show
          fabrizio giustina added a comment - committed to cvs added a sortProperty attribute to column tag.
          Hide
          Grégory Joseph (old account) added a comment -
          I'm having troubles getting this to work?

          In the files proposed in the "patch", I see a new constructor of RowSorter which takes the original non-decorated value (at least that's what i'm assuming), but this ctor doesn't seem to be in the sources of dt-1.0-rc2 !?
          Show
          Grégory Joseph (old account) added a comment - I'm having troubles getting this to work? In the files proposed in the "patch", I see a new constructor of RowSorter which takes the original non-decorated value (at least that's what i'm assuming), but this ctor doesn't seem to be in the sources of dt-1.0-rc2 !?
          Hide
          Grégory Joseph (old account) added a comment -
          I think I get it now:
          If the property is the same as the sortProperty, then displaytag still sorts with the decorated value. Simply because it doesn't make the difference between the two.
          So if you use the same name for your decorated values (which should be the case for most people, right?) then this issue is not resolve, IMHO.

          And, if I may add my opinion, I think the *default* behaviour should be to sort on non-decorated value.

          (Think about timestamps: I'm not decorated them, I have a java.util.Date property in my objects... They're being printed out with the default toString() method of Date which return stuff like "Mon Nov 22 20:54:07", "Tue Nov 23 10:48:20 CET 2004" .. And displaytag sorts my dates on that string instead of the actual date object, which make the sorting totally wrong... That is, even without using a decorator...)
          Show
          Grégory Joseph (old account) added a comment - I think I get it now: If the property is the same as the sortProperty, then displaytag still sorts with the decorated value. Simply because it doesn't make the difference between the two. So if you use the same name for your decorated values (which should be the case for most people, right?) then this issue is not resolve, IMHO. And, if I may add my opinion, I think the *default* behaviour should be to sort on non-decorated value. (Think about timestamps: I'm not decorated them, I have a java.util.Date property in my objects... They're being printed out with the default toString() method of Date which return stuff like "Mon Nov 22 20:54:07", "Tue Nov 23 10:48:20 CET 2004" .. And displaytag sorts my dates on that string instead of the actual date object, which make the sorting totally wrong... That is, even without using a decorator...)
          Hide
          added a comment -
          http://www.sneerzine.com/ <a href="http://www.sneerzine.com/">biloxi casinos</a> thanks
          Show
          added a comment - http://www.sneerzine.com/ <a href=" http://www.sneerzine.com/ ">biloxi casinos</a> thanks
          Hide
          added a comment -
          http://www.mylosoft.com/ <a href="http://www.mylosoft.com/">world series of poker</a> thanks for your site
          Show
          added a comment - http://www.mylosoft.com/ <a href=" http://www.mylosoft.com/ ">world series of poker</a> thanks for your site

            People

            • Reporter:
              Jason Lee
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5 minutes
                5m
                Remaining:
                Remaining Estimate - 5 minutes
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified