This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes div show/hide with struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "div show/hide with struts2" Watch "div show/hide with struts2" New topic

div show/hide with struts2

Mike Nason

Joined: Apr 19, 2006
Posts: 20
I am using struts2 and need to show/hide some textboxes in my <s:form>.
I did this by using JS code:

The problem that these method doesn't work with default xhtml theme, and I need to set <s:form theme="simple"> and use custom layout to make that works.
Using simple theme broke my UI on that page, because I am using default struts2 layout on others.
Does anybody have any ideas of how to show/hide textboxes by using default html theme with struts2 layout???

Wanna code??
David Newton

Joined: Sep 29, 2008
Posts: 12617

You either need to hide/show individual form elements, or modify a theme to give you more control over what appears.

I don't recall if someone has done the work to give for rows IDs yet--it's been on my list of things to do and now that I have some time hopefully I'll finally get around to it if nobody's done it yet (especially since I have the code sitting on my local machine already :/
It is sorta covered in the JavaRanch Style Guide.
subject: div show/hide with struts2