File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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

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

Richard Vagner
Ranch Hand

Joined: Jun 26, 2001
Posts: 108
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,
David Newton

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.
I agree. Here's the link:
subject: How to overwrite the layout of "wwFormTable" in Struts2?
It's not a secret anymore!