This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes FormBean - Hidden variable not set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "FormBean - Hidden variable not set" Watch "FormBean - Hidden variable not set" New topic
Author

FormBean - Hidden variable not set

Thilothama Green
Greenhorn

Joined: May 13, 2004
Posts: 14
Hi,

I have 2 jsp pages using same Form and same Action Class.
Page contains a list of values and on clicking any one of the list, goes to second page which is a tabbed page.

I am having a hidden variable pageDispatch in all the pages and on submit of any pages's form, I set the dispatch with that particular page's value.

I have my action form bean in session scope. The javascript I use to set the dispatch shows that the value is set(I used alerts). But when in the action, if I try to get that dispatch value, its showing the default value I set for it in the page. What am I missing?

Thanks
s penumudi
Ranch Hand

Joined: Nov 17, 2004
Posts: 113
I guess your not submitting your form.
Thilothama Green
Greenhorn

Joined: May 13, 2004
Posts: 14
I am submitting the form and I could do some other operations.
Pavan Tummala
Ranch Hand

Joined: Dec 25, 2004
Posts: 74
How r u setting the hidden property.
I set it using something like this:

document.forms['formName'].action.value = "edit";
formName.submit()
return true;

where action is the hidden form property.


If Java had true garbage collection, most programs would delete themselves upon execution -- Robert Sewell
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
"Thilothama T",

Welcome to JavaRanch. We don't have many rules here, but we do have a naming policy. Please take this opportunity re-read our policy and edit your display name in order to comply. Thanks and we look forward to seeing you around the Ranch.
Thilothama Green
Greenhorn

Joined: May 13, 2004
Posts: 14
I have two jsp pages in a tab structure. One of the pages in the tab works fine for the dispatch function. Only the other page is not working. I found out that not even any javascript is working in that page. Working on it.

Thank you all for your help.

Thilothama.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FormBean - Hidden variable not set
 
Similar Threads
Issue when retrieveing the hidden variable in script and setting the locale of dojoconfig
Validator help for shared form bean
How do you pass command related parameters from page to page in Spring Web Flow
navigating to two different pages with two different buttons
Need Solution for accesing Action servlet only on Submit