velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Van Horn <matthew_van_h...@yahoo.com>
Subject Re: AbstractPagerTool
Date Tue, 10 Aug 2004 16:14:23 GMT
On Tue, 2004-08-10 at 23:50, Nathan Bubna wrote:
> Matthew Van Horn said:

> still counts in my book.  :)
> 
> the tool looks pretty good.  the only real change i made while playing with it
> last night (and make AbstractSearchTool a subclass) was to change the
> terminology (and method/variable naming) from "results" to plain "items",
> because "results" implies a query to me and the pager tool doesn't do that.
> what do you think about that?

Sounds good to me. I didn't like 'results' either, but I was just too
tired to think of something else. 'Items' is good. *smacks forehead*

Now, I've got another itch to scratch with the link tool. Maybe there is
alread a good way of doing this, but I haven't seen it yet. (Did I
mention I'm tired...:) 

When I am using paging, I end up with two parameters in the query
string. However, other stuff on the page requires some parameters as
well. So I have a URL like:

http://mysite.com/mypage.do?pagesize=10&index=20&sortby=name&sortdir=desc

If I copy the whole querystring, and the do addQueryData('index', 30)
I will get:
http://mysite.com/mypage.do?pagesize=10&index=20&sortby=name&sortdir=desc&index=30
which is wrong, since there are 2 index params.

I am thinking there should be a 
updateQueryData(String name, String value) which would add the
name/value but if it already existed, it would overwrite the old value.
Right now, I am using too much logic in my template to do this.
(checking the name of each param in a loop, before calling addQueryData)
It is not as maintainable as I'd like.

What do you think of this idea? The way the QueryPairs are stored, I
probably have to do the same loop w/ conditional over the ArrayList, but
at least template designers don't have to hard code the parameter names
to check for.

-- 
Matthew Van Horn <matthew_van_horn@yahoo.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message