Hi,
I am using a display tag for pagination in my JSP page. I have a checkbox field as one of the columns. I am using displayTagWrapper class to display my checkboxes. I have a submit button in a page which will save checkbox status into the database. I also have pagination and sorting in the page.
The problem i have is, i will loose the status of the checkbox when i go to second page. If i select some of the checkboxes in page 1 and go to page 2 to select some more and if i come back, i loose all the selected checkboxes in page 1.
Is there a way where i could save my check boxes in session and its checked while i browse across pages and gets submitted all at once.
Any help is appreciated
Thanks
-
displaytag - maintaining status of checkbox during pagination (6 messages)
- Posted by: Offense Offense
- Posted on: July 18 2005 11:50 EDT
Threaded Messages (6)
- displaytag - maintaining status of checkbox during pagination by Marina Prikaschikova on July 19 2005 03:00 EDT
- displaytag - maintaining status of checkbox during pagination by Offense Offense on July 20 2005 10:23 EDT
-
displaytag - maintaining status of checkbox during pagination by Ramesh Bhagasra on September 06 2005 04:51 EDT
-
displaytag - maintaining status of checkbox during pagination by Emmanuel Cornette on December 14 2005 07:48 EST
- displaytag - maintaining status of checkbox during pagination by Emmanuel Cornette on December 14 2005 07:50 EST
-
displaytag - maintaining status of checkbox during pagination by Emmanuel Cornette on December 14 2005 07:48 EST
-
displaytag - maintaining status of checkbox during pagination by Ramesh Bhagasra on September 06 2005 04:51 EDT
- displaytag - maintaining status of checkbox during pagination by Offense Offense on July 20 2005 10:23 EDT
-
displaytag - maintaining status of checkbox during pagination[ Go to top ]
- Posted by: Marina Prikaschikova
- Posted on: July 19 2005 03:00 EDT
- in response to Offense Offense
Is there a way where i could save my check boxes in
>session and its
you have to submit your page by some way. E.g. you can make asynch call to your server side on box selection.
Marina
http://www.servletsuite.com -
displaytag - maintaining status of checkbox during pagination[ Go to top ]
- Posted by: Offense Offense
- Posted on: July 20 2005 10:23 EDT
- in response to Marina Prikaschikova
But i dont have a way to submit. I am browsing through records and checking the rows i want to submit -
displaytag - maintaining status of checkbox during pagination[ Go to top ]
- Posted by: Ramesh Bhagasra
- Posted on: September 06 2005 04:51 EDT
- in response to Offense Offense
Hi,
i am also facing the same problem, if you have found the solution, plz let me know.
Thanks,
Ramesh -
displaytag - maintaining status of checkbox during pagination[ Go to top ]
- Posted by: Emmanuel Cornette
- Posted on: December 14 2005 07:48 EST
- in response to Ramesh Bhagasra
You have to catch the click on the header and manage it yourself, in javascript for example. I'm doing it with this piece of code :
function prepareTableHeader(tableName)
{
var table = document.getElementById(tableName);
var header = table.getElementsByTagName("thead");
var links = table.getElementsByTagName("a");
for (i=0; i < rows.length; i++) {
var curLink = links[i];
curLink.onclick = function() {
var target = curLink.search;
var toadd = target.subString(1,target.length);
var baseaction = document.forms[0].action;
if (baseaction.indexOf("?") == -1)
{
document.forms[0].action = baseaction + "?" + toadd;
}
else
{
document.forms[0].action = baseaction + "&" + toadd;
}
document.forms[0].submit();
return false;
};
}
}
do not forget to call this mehod in the onload of the body tag.
PS : The submit of my form ensure does not modify anything on the server side (I use a "name" attribute on the submit buttons to select the operation that has to be done. If no operation is selected, I only refresh the screen with the values in the fields on the screen. Spring helps me a lot in doing that)
I hope it helps. -
displaytag - maintaining status of checkbox during pagination[ Go to top ]
- Posted by: Emmanuel Cornette
- Posted on: December 14 2005 07:50 EST
- in response to Emmanuel Cornette
additional precision :
I'm doing that to maintain the state of other input fields on the same page than the list when I click on the sort header. You have to adapt it for your own need. -
on Submit[ Go to top ]
- Posted by: iz iz
- Posted on: February 02 2010 02:19 EST
- in response to Emmanuel Cornette
I was able to implement the codes successfully (thank you!) however, I cant seem to do any action like copying and deleting my selections.. how can i pass the value of my selections to a submit? Thank you