I could be wrong, but I thought that sortColumn = -1 meant that there
wasn't a sort column, which is prefectly valid. Why do you think this
needs to be set to 1? Are you arguing that it should always sort on the
first column( or, actually second column, since 0 would technically be the
first, wouldn't it? ). If that's the case, I disagree for this reason: If
I present the display tag with data that is already sorted, it should just
display exactly what I give it and not waste time sorting it.
Either way, we need to get some unit tests in here before making too many
more changes.
John
On Wed, 19 Mar 2003, Dave Hodson wrote:
> One more bug to submit a change for (I don't have CVS access...)
>
> The reset method needs to be modified:
>
> currently it is as follows:
>
> public void reset()
> {
> this.pageNumber = 1;
> this.sortColumn = 1;
> }
>
> The bug is that this.sortColumn is initialized as "-1", not "1". To correct this,
> the reset method should be changed as follows:
>
> public void reset()
> {
> this.pageNumber = 1;
> this.sortColumn = -1; <---- change
> }
>
> Dave
>
>
>
> > -----Original Message-----
> > From: Dave Hodson
> > Sent: Wednesday, March 19, 2003 3:50 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [displaytag-devel] Bug in paging when using Tomcat 4.1.18
> >
> >
> > Zorzella
> >
> > Thanks for the reply - I agree that the code should not cause
> > an exception in the case of the requested pageNumber being
> > greater than the number of available pages. However, the
> > problem I mention stems from the fact that Tomcat is not
> > calling the reset() method anymore, which turns out to mean
> > that the display object values are not reset when a second
> > request is made (!!) This can literally mean that if you and
> > I are using an application and you hit page 6 and then I use
> > the same thread, the pageNumber value for me will
> > *inititally* be 6, not 1.
> >
> > BTW, I took a look in CVS and the change you submitted
> > (moving this.pageNumber = 1 above the if page != null case)
> > does not fix the issue for sort. I think the best way to
> > solve this is to call reset() as shown below.
> >
> > Dave
> >
> >
> > > -----Original Message-----
> > > From: Luiz-Otavio Zorzella [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, March 19, 2003 3:43 PM
> > > To: Dave Hodson
> > > Cc: [EMAIL PROTECTED]
> > > Subject: Re: [displaytag-devel] Bug in paging when using
> > Tomcat 4.1.18
> > >
> > >
> > > I don't think the system should ever balk at that kind of stuff...
> > >
> > > Another circumstance this may happen is if the data is erased
> > > from the
> > > DB after you get a page, then you hit another page...
> > >
> > > Right now, there is even an "if" for the "exceptional case"
> > that the
> > > collection returned is empty (thus it would not even have a
> > > first page,
> > > you see?).
> > >
> > > I think I should just set the current page to be the last
> > > page if it's
> > > more than the number of pages... And to be the first if it's
> > > negative...
> > > why not? Let's do kind of like google:
> > >
> > > http://www.google.com/search?q=test&hl=en&lr=&ie=UTF-8&oe=UTF-
> > > 8&start=10000000000000000000&sa=N
> > >
> > > http://www.google.com/search?q=test&hl=en&lr=&ie=UTF-8&oe=UTF-
> > > 8&start=-1&sa=N
> > >
> > >
> > > I'll do it by tomorrow.
> > >
> > > Zorzella
> > >
> > > Dave Hodson wrote:
> > > > I'm using .8 version of the display tag with Tomcat 4.0.3
> > > and everything works properly
> > > >
> > > > Recently, I upgraded to Tomcat version 4.1.18 and have
> > > noticed that the paging functionality does not work properly.
> > > > For example, I create a table that has 8 pages by selecting
> > > a valid date range in an HTML popup. Upon the initial display
> > > of the the table, Page 1 is shown. I then click on Page 6,
> > > which is displayed properly. Next I modify my date range so
> > > that the resulting table consists of only 2 pages. This
> > > crashes with the msg
> > > >
> > > > "Invalid page (6) provided, value should be between 1 and 2'"
> > > >
> > > > Digging around, it turns out that Tomcat 4.1.18 no longer
> > > calls the reset() method between calls and this effectively
> > > leaves the value "pageNumber" at 6 the next time a user hits
> > > the screen (the gory details about the Tomcat bug are at
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16001)
> > This bug has been marked INVALID, so I don't think it will be
> > fixed anytime soon.
> > >
> > > Has anyone seen this problem and/or is there a fix for
> > this? Seems like the thing to do is call the reset() method
> > in the doStartTag() method, before the request object is
> > obtained. Something like
> > >
> > > columns = new ArrayList( 10 );
> > > reset(); <------ add it here
> > > HttpServletRequest req =
> > (HttpServletRequest)this.pageContext.getRequest();
> > >
> > > Thoughts?
> > >
> > > Dave
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Does your code think in ink?
> > > You could win a Tablet PC. Get a free Tablet PC hat just
> > for playing.
> > > What are you waiting for?
> > > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> > > _______________________________________________
> > > displaytag-devel mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/displaytag-devel
> > >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Does your code think in ink?
> > You could win a Tablet PC. Get a free Tablet PC hat just for playing.
> > What are you waiting for?
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> > _______________________________________________
> > displaytag-devel mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/displaytag-devel
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Does your code think in ink?
> You could win a Tablet PC. Get a free Tablet PC hat just for playing.
> What are you waiting for?
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> _______________________________________________
> displaytag-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-devel
>
--
John York
Software Engineer
CareerSite Corporation
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel