Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

ActionForm losing values

 
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?
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • 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.
 
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
 
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
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic