I don't know why we should have to resort to these kinds of tricks. Adding a sortProperty attribute would be highly appropriate.


[EMAIL PROTECTED] wrote on 06/18/2004 05:43:02 AM:

> Good suggestion Bryan.
>
> After a little testing, I found another workaround that's a little more
> standards-compliant.  Instead of using an incorrect tag, just use an
> HTML comment.
>
> The problem that I have with using an incorrect tag is what happens when
> that incorrect tag turns out to be a correct one?  For example, using
> your code below, if facility.getDepartmentName() returned "button", then
> the resulting HTML code would look like this:
>   <button/><a href=""> > Sure, the example's a little contrived, but it does convey the problem.
>
> A better solution would be to use standard HTML comment tags.  These
> will never result in inappropriately interpreted tags.  Therefore, using
> the contrived example above, the resulting HTML code would look like
> this:
>   <!-- button --> <a href=""> > In terms of 'tricking' the DisplayTag sorter into properly sorting, this
> works for me 100%.
>
> So, thanks again for the suggestion.  I hope that my reply is useful to
> you too.
>
> JDG
>
> PS: I've included the DisplayTag email list for posterity.  I hope you
> don't mind.
>
> --
> Jay Glanville
>
>
> > -----Original Message-----
> > From: Bryan Hansen [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 17, 2004 1:45 PM
> > To: Glanville, Jay
> > Subject: RE: [displaytag-user] How can I sort based not on
> > what's in the cell?
> >
> >
> > Jay,
> >
> > We just found a little workaround for the sorting with
> > decorators. Browsers
> > with ignore incorrect tags embedded in html. So I just put in
> > a fake tag at
> > the start of my url on what I want to sort and it works just fine.
> >
> >
> >
> >  public String getOrganizationStake() {
> >       FacilityDO facility = (FacilityDO) getCurrentRowObject();
> >
> >       String name ="<" +
> >  right here ------>    facility.getDepartmentName()
> > <----------right here
> >             + "/><a href=""> > >             + getListIndex()
> >             + "&facilityOid="
> >             + facility.getFacilityOid()
> >             + "\">"
> >             + facility.getDepartmentName()
> >             + "</a>"
> >             + " <br>&nbsp;&nbsp;"
> >             + "<a href=""> > >             + getListIndex()
> >             + "&facilityOid="
> >             + facility.getFacilityOid()
> >             + "\">"
> >             + facility.getStakeMissionName()
> >             + "</a>";
> >      
> >       return name;
> >    }
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> displaytag-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>

Reply via email to