aspose file tools*
The moose likes Struts and the fly likes Possible to have one frame submit another? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Possible to have one frame submit another?" Watch "Possible to have one frame submit another?" New topic
Author

Possible to have one frame submit another?

Bob Carpenter
Greenhorn

Joined: Oct 28, 2005
Posts: 9
I'm using Struts 1.2. I have a two frame UI. The left frame is ControlsFrame for button controls (New, Save, Print,...), the right frame is the ViewerFrame with fields, dropdowns, etc.

Both frames have their own Forms and Actions - ViewerForm, ControlsForm, ViewerAction, ControlsAction.

I get the ViewerFrame populated with the data I want, then click the Print button and have a window popup showing the contents of the ViewerFrame minus all the dropdowns.

I want the ControlsFrame to somehow submit the ViewerFrame so that its form data is available for the Print window. I prefer not to have a "Submit" button in the ViewerFrame.

Any ideas how to solve?

Thanks,

BobC
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You can use JavaScript to submit a form in another frame. Something like this:

parent.viewFrame.document.forms[0].submit();

Where viewFrame is the name you gave the frame when you defined it. (<frame name="viewFrame">).
[ April 17, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Bob Carpenter
Greenhorn

Joined: Oct 28, 2005
Posts: 9
Hi Merrill,

Thanks for the info. This works great!

--BobC
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Possible to have one frame submit another?