This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Cannot assign a value to a struts form

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, everyone!

If anyone can assist me, please let me know.

There may be a simple solution to this, or it is just some sort of error I have, but I cannot firure it out for a while now.

Everything seems to be fine.

I have jsp page, I have a struts form. I have action class.

Jsp has form that will do some sort of things: search, edit, add...
Also page has a scrollolling functionality which works!

When performing search, everything works fine: all form's property are assigned values, action gets this values and sends to appropriate business logic and gets back values in the collections.Collection is put into session.

When retrieving values in jsp page I have "edit" button, when it is clicked, I call javascript function with a "key" value as a parameter.
Set the from property to that key and submit it to a particular action.

What happens is the first time when I do that, form's property is successfuly asigned to the "key", action retrieve that property from the form and sends it to a business logic to get searched data.

ALL THIS WORKS THE FIRST TIME WHEN I CLICK "EDIT". When I try to select another data, and click on "edit", the correct values are passed to javascript function, but form still gets the old values.

Moreover, after clicking "next" to go to the next set of records, I'm able to get a different data but for one record only.

IF ANYONE COULD HELP ME, PLEASE, I WOULD REALLY APPRICIATE IT.

Thank you in advance.


Eugene
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The cause of your issue does not jump out to me. Could you expand more on "the correct values are passed to javascript function, but form still gets the old values"? Maybe if you posted your function and the relevant sections of your action and/or form class somebody could help out.

- Brent
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the scope of the form? if it's request it could be losing some of the values.
 
reply
    Bookmark Topic Watch Topic
  • New Topic