• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionForm losing values

 
John Smith
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble with an ActionForm of mine losing the values I set in it. The form page has some drop-downs whose options are generated from bean lists set in pop-ups, I need to be able to refresh the page and have the form retain it's values as set in the other fields. I've put redirect="false" in all action mapping and put empty reset methods in the relevant form classes and it still doesn't work, any bright ideas?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the form request scope? If so, the refresh would create a brand-spankin' new ActionForm.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marc Peabody:
Is the form request scope? If so, the refresh would create a brand-spankin' new ActionForm.


Yeah, I was going to say the same thing. What happens if you set the form bean to be in session scope?
 
John Smith
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm yeah I presume it's session scope, I'm using the form-bean mapping in the struts-config.xml ... I don't think it creates a new form because I printed the class instance.toString() in the Action's execute method and it stays at the same memory address. Usually the forms keep values unless I clear them with the xml mapping method but this one is the opposite for some reason
 
ss kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John Smith ...Was your problem resolved??...please let me know , I am in the same boat. I want to keep the values selected in my select box. I tried making the scope to session and also using the redirect=false in the struts-config.xml

Thanks in advance.
shoban
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic