I"ve set the following on the displaytag.properties for the paging.banner
 attributes: 
  
 paging.banner.last=Result Pages: [<a
 href="javascript:doPage(""SearchResult"", ""{1}"");">First</a>/<a
 href="javascript:doPage(""SearchResult"", ""{2}"");">Prev</a>] <font
 class="currentPage"> {0} </font>
 
 Where "doPage" is a javascript method:
  
 function doPage(fname, actionName) {
  document.forms[fname].action = actionName
  document.forms[fname].submit();
 }
  
 Thanks
 Chidambaram Pl

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Rick
Herrick
Sent: Thursday, February 17, 2005 11:02 PM
To: [email protected]
Subject: Re: [displaytag-user] Submit values of input fields when
clicking on paging link/sorting link


Chidambaram P.L. said:
>       I am using display tag to show a search results screen with checkbox
> against each record displayed. When a checkbox is selected and next page
> link is clicked, the checkbox value is not submitted as part of request
> param. Is there a way to tell the display tag to submit the values of the
> input fields in the current page, when a pagination link or sort link is
> clicked?

There are two solutions: you can heavily modify the various paging
properties in TableTag.properties (well, you'd override them in your own
displaytag.properties, as described in
http://displaytag.sourceforge.net/configuration.html).  Specifically,
you'd need to modify paging.banner.full, paging.banner.first, and
paging.banner.last to grab the generated URL and modify it to submit the
form along with the paging (and any ordering) parameters along with the
checkboxes.  Sounds like kind of a nightmare to me.

The second solution is just to NOT do what you're suggesting.  As a
general interface rule, you probably shouldn't have this kind of
functionality.  Suppose I go to the first page of the data set, select a
couple of items, then go to the next page, select a couple of items, and
so on.  Five or six pages into it, what have I selected?  I can't really
tell without going backwards, which is both inconvenient for the user and
provides you with another data management task restoring the checkboxes of
the selected items.

I'd suggest instead having some sort of way of selecting items on each
page, then adding them to a list that is also displayed.  Something like
this:

Things                   Selected Things
[ ] Item 1
[ ] Item 2
[ ] Item 3     Add->
[ ] Item 4
[ ] Item 5
                                  Next->

So the user selects Item 2 and Item 4, then clicks Add.  It now appears
like this:

Things                   Selected Things
[ ] Item 1               Item 2
[*] Item 2               Item 4
[ ] Item 3     Add->
[*] Item 4
[ ] Item 5
                                  Next->

Now click Next and it looks like this:

Things                   Selected Things
[ ] Item 6               Item 2
[ ] Item 7               Item 4
[ ] Item 8     Add->
[ ] Item 9
[ ] Item 10
<-Prev                            Next->

Select a couple here, they're added to Selected Things, keep paging
around, etc.  Then, when the user clicks OK or Submit or whatever, only
the list of Selected Things is submitted to the final operation.

This addresses both the interface issues with your problem and trying to
make the Prev and Next clicks serve dual purposes.

-- 
Rick Herrick
[EMAIL PROTECTED]

Proud member of the reality-based community

Never try to discourage thinking for you are sure to succeed.--Bertrand
Russell


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to