Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pagination problem

 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
In jsp , i have a text box, where the user entes some name and clicks teh submit button
Then, results will be displayed in teh same page. I am using the pagination for this. Upon clickkin gthe "next" or previous links, it is paginiating properly only. now my problem, the value, which the user entres in the text box is disappearing ..
How to retain the text box value, when the user navigates between the results using pagination.
thanks
Raman
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any suggestions o n this?/
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PLease help me on how to retian the user's input, when he uses pagination to see the resutls as explained above
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you use struts, if you do and have a attribute in the form bean corrs to the text field name and if the scope of the form in the action is session then you should be able to retain the value of the text box. If you are not using struts then use the plain old jsp format of setting the variable in the session and using that to populate the field(not recommended)
HTH
Sahil
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by desi dude:
do you use struts, if you do and have a attribute in the form bean corrs to the text field name and if the scope of the form in the action is session then you should be able to retain the value of the text box. If you are not using struts then use the plain old jsp format of setting the variable in the session and using that to populate the field(not recommended)
HTH
Sahil

Thanks Sahil.. That really helped a lot. yes. i am usinmg struts!!
MT
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actualy , it is not working .. I tried putting it in a sessin scope!!

mt
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a common problem in this is the value in the input tag. make sure that you do not have the value set and that you do not set the value of the attribute in the formbean anywhere or reset it in the form bean after the user enters it.
Sahil
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by desi dude:
a common problem in this is the value in the input tag. make sure that you do not have the value set and that you do not set the value of the attribute in the formbean anywhere or reset it in the form bean after the user enters it.
Sahil

yes.. what you said is correct!! Somewhere, the attribute (lastname) in teh form is reset to null. I verified my code everywhere.. but no where, I explicitly mentioned that it shd become null.
As soon as I click on Search button, the name will be there, even after it displays the results at thebbottm. But, once I click the next button/last button, the value in the text box disappears.
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by desi dude:
a common problem in this is the value in the input tag. make sure that you do not have the value set and that you do not set the value of the attribute in the formbean anywhere or reset it in the form bean after the user enters it.
Sahil

Hi Sandy/Sahil
After posting the my message, I re-read your post and "reset" word caught my attention. And Yes. you guessed it right!! Actually , I used that reset method and setting it to null. I just commented it and its woirking fine!!
Thanks Buddy!! You really saved my day!!
Please visit this forum regularly!! There are many people , who post questions like this.
thanks again!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic