• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Richard Vagner
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic