Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Maintain checked and unchecked in checkbox in pagination  RSS feed

 
rahulj rjagtap
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
all
I want to maintain the state of checkboxes across pages.
What happens is when i check one checkbox and then go to say 2nd page then check one checkbox there and when i return to previous page the checked box is again unchecked.
Means the status of the checkbox is not maintained.If it is maintained then it should show checked.

I am using jsps and display tag in jsp for pagination.
Any kind of help would be greatly appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66198
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Red text on tan is completely unreadable.
 
John Pradeep.v
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rahulj rjagtap wrote:hi,
all
I want to maintain the state of checkboxes across pages.
What happens is when i check one checkbox and then go to say 2nd page then check one checkbox there and when i return to previous page the checked box is again unchecked.
Means the status of the checkbox is not maintained.If it is maintained then it should show checked.

I am using jsps and display tag in jsp for pagination.
Any kind of help would be greatly appreciated.


i think you should be capturing the values entered by the users somewhere in the session? your checkbox code should contain a conditional way of making it checked or unchecked like below.

<input type="checkbox" checked="<<read the previous value form session>>" />
 
rahulj rjagtap
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you John Pradeep.v for your reply.
You are saying is right. I tried to implement what you had said. But i am getting difficulty in it because i am new to java.

Could you please explain me giving some example of code.
Thanks for your help in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66198
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect you'd get more responses if people could actually read your post. I've removed the red coloring from the text for you. In the future, please use color only sparingly and for emphasis. Making your posts hard to read is not the best strategy for getting people to help you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!