Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[struts] using html:form across multiple divs

 
Jonathan Lister
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application presents multiple rows of data in the upper part of page, each of which has an html:multibox to allow user selection. The lower part of page has some controls built with e.g html:radio, html:checkbox, html:select and html:submit. The upper & lower parts of the screen are built via 2 calls to tiles ut. All is working well.

Next request from user's is to "fix" the controls across the bottom of the screen - so they don't have to keep scrolling down to find the controls.
I think there are 2 possible HTML approaches
a) frames
b) CSS positioning and DIV tags

There seems to be significant challenges involved in using frames together with struts, so I have investigated CSS and DIV tags. After jumping over several hurdles to find workarounds to the "bugs" in IE etc, I have a solution that looks nice on screen and is reasonably clean - keeping most of the detail in a tiles layout definition. However, I'm having some difficulty in nesting div's within a html:form or vice-versa. The only way I can find to keep the visual appearance ok is to nest a html:form within each div tag:
<div id="bodyContent">
<html:form ..>
<main content goes here>
</html:form>
</div>
<div id = "bottomFrame">
<html:form ....>
<toolbar, buttons etc. goes here>
</html:form>
</div>

but of course the form doesn't work, I assume because each form is independant of the other and selections made in the top form are invisible when a button in the lower form is clicked. Wrapping one html:form around the outside of both sections fixes that problem, but introduces other problems like making it difficult to use the multiple tiles ut sections and breaking the visual appearance.

Has anyone been down this or a similar path before - is there an easier way to acheive what the user's want?
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then its better to with frames that will make use ur life easier even though frames is not that good idea in big applications .......if u use frames there is no quetsion of tiles at all u can give src="action.do" for evry frame and proceed

if u go with divs why do u need to have three forms i am not able to understand clearly ur req
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could ask the users about putting controls at both the top and bottom of the screen. They might like it.
 
Jonathan Lister
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to answer sreenath, I don't want multiple forms, but doing it this way:
<html:form ..>
<div id="bodyContent">
<main content goes here>
</div>
<div id = "bottomFrame">
<toolbar, buttons etc. goes here>
</div>
</html:form>

breaks the visual appearance, at least in IE6, specifically I lose the vertical scroll bar and can't access lower parts of the page!

Getting back to struts - is there a way to combine the input from multiple <html:forms> without using e.g. javascript to write the combined data to yet another (hidden) form?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't you just wrap the divs with a single html:form???
<body>
<html:form...>
...
div
...
div
...
</html:form>
</body>
 
Jonathan Lister
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marc, yes, I can wrap the divs in a single html:form (that is waht my post above was trying to show). Using a single html:form is GOOD from struts / functional perspective (it works), but BAD from a visual perspective - putting the divs inside the form upsets the rendering badly, at least in IE6.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic