wood burning stoves 2.0*
The moose likes Struts and the fly likes How to overwrite the layout of Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to overwrite the layout of "wwFormTable" in Struts2?" Watch "How to overwrite the layout of "wwFormTable" in Struts2?" New topic
Author

How to overwrite the layout of "wwFormTable" in Struts2?

Richard Vagner
Ranch Hand

Joined: Jun 26, 2001
Posts: 107
Overwriting the default wwFormTable can only change the font of the label and background of the table but not the layout of the form.

Is there a way to have user name and password, for example, on the same row instead of separating them into separate rows defined by the default style? In other words, how to achieve this:


Instead of


Any idea?

Thanks a lot,
Rich
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Use the "simple" theme.

This sacrifices some functionality (notably the display of field-specific error messages), but with a form layout like this you probably wouldn't want the default anyway.

Bonus info:

In cases like this I'll often create "virtual" field error messages--so in an action's validate() method I'll call super.validate(), check for an error on the first or last name, and if present add a field error message for "full_name" or something similar. Then in the form JSP code I'll check for the existence of the pseudo-field error and display it.
 
 
subject: How to overwrite the layout of "wwFormTable" in Struts2?