Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with fields not being remembered after refresh

 
Eric Juneau
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I'm in struts 2.0 and appcelerator.

I have a form where there are some search criteria fields (field set A), a data table, and "submit button" that calls Method A in the action. Below that some more fields (field set B) and an "add item" button which acts like another submit button that calls Method B in the same action.

When you click "add item" button, it calls Method B and saves the data from field set B. Then the form refreshes, but any of the data you filled out in field set A is forgotten. I know its in the Action when Method B is called. It displays field set A if an error occurs when calling Method B, but not if it completes successfully. I want the form to remember the data that was entered in field set A when Method B completes succcessfully. It appears to be totally refreshing the form as a redirect-action, which is good, because the data table is supposed to show the newly added item. I've tried hidden fields on the jsp but these don't seem to work.

Let me know if you have any questions or need clarification on anything.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need clarification: actions are created per-request; if you redirect you're getting a new action instance.
 
Eric Juneau
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a different framework for achieving what I needed to accomplish using Ajax.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic