wood burning stoves
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "FormBean - Hidden variable not set" Watch "FormBean - Hidden variable not set" New topic

FormBean - Hidden variable not set

Thilothama Green

Joined: May 13, 2004
Posts: 14

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?

s penumudi
Ranch Hand

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

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";
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

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

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.

It is sorta covered in the JavaRanch Style Guide.
subject: FormBean - Hidden variable not set
It's not a secret anymore!