This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes <sj:accordion> tag questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "<sj:accordion> tag questions" Watch "<sj:accordion> tag questions" New topic

<sj:accordion> tag questions

Glen Divers
Ranch Hand

Joined: Jan 21, 2010
Posts: 61

I'm trying to use the accordion tag for the first time, and it's all pretty much working. However I have a couple of niggling problems and I'm hoping that someone can point me in the right direction.

The first is a minor niggle. The default behaviour when the jsp is displayed for the first time is for the first accordionItem to be open. I'd like the initial state to be all closed.

The second is more of a problem. In the generated html, the tag is assigning a style="height:1068px" to each div which is far far too big. Where is this being set? Ideally, I'd like each div to size itself according to the size of the content (which in my case varies considerably from "tab" to "tab"). Is this possible?

Glen Divers
Ranch Hand

Joined: Jan 21, 2010
Posts: 61
OK - setting <sj:accordion active="false" collapsible="true"/> seems to take care of making the default display start with all accordion tabs shut.

Regarding the sizing of the individual accorion tabs, the autoHeight attribute seems relevant here, but doesn't appear to behave any differently whether is set "true" or "false", all the panels are sized the same size and way way too big. Anyone know what I'm missing?
jQuery in Action, 2nd edition
subject: <sj:accordion> tag questions
Similar Threads
Tag library that can display 'pretty' XML
jQuery tabs UI issue
Content of Div tag Behavior
What is the simplest way to order this?
Failing to validate using ditchnet tabs