Thanks Martin. I tried to add theme="ajax" for the div for the first tab, it works. Now, it generates similar code as you posted here. In conclusion, there are two errors in the document page (http://struts.apache.org/2.x/docs/ajax-tags.html): 1. It didn't say that we need to put <s:head theme="ajax"/> on the page. Thanks to Dave Newton for pointing that out. Without this line, the tabs don't show at all, at least in Eclispe WTP environment. 2. Although it gives a warming for the ajax theme, but it doesn't have correct code in the samples. That was why I was confused. Now, I can generate tabs as I want. Many thanks to the people who support this community. Willa ----- Original Message ---- From: Martin Gainty <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Friday, April 13, 2007 12:25:11 PM Subject: Re: [S2] Cannot run TabbedPanel tag
The struts examples define the individual Tab categories as <script type="text/javascript"> dojo.require("dojo.widget.TabContainer"); dojo.require("dojo.widget.LinkPane"); dojo.require("dojo.widget.ContentPane"); </script> then populate the div tags using the predefined dojoTypes <div dojoType="TabContainer" id="test" doLayout="false"> <div dojoType="struts:BindDiv" id="one" label="Page" showError="true"> <h3>Unknown page</h3> <pre> </pre> </div> <div dojoType="struts:BindDiv" id="two" label="Configuration" showError="true"> <h3>Unknown configuration</h3> <pre> </pre> </div> <div dojoType="struts:BindDiv" id="three" label="Java Action" showError="true"> <h3>Unknown or unavailable Action class</h3> <pre> </pre> </div> </div> HTH M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. ----- Original Message ----- From: "Minerva CC" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Friday, April 13, 2007 2:01 PM Subject: Re: [S2] Cannot run TabbedPanel tag > Thanks Dave for your help. > > I tried to add <s:head theme="ajax"/> in my page and all the html tags to > the test.jsp. Then, I got only one tab showing up, which is dynamic one > with a close icon. In the panel, I have both panel contents displayed. > When I click on the close icon, the dynamic panel content was collapsed. > > I also tried to put the theme ajax all over the place, in the header, > outside and inside the tabbedpanel and I got the same result. Would you be > kindly point it out what is wrong? > > <%@ taglib prefix="s" uri="/struts-tags"%> > <html> > <head> > <script type="text/javascript"> > </script> > <s:head theme="ajax"/> > </head> > <body> > <s:url id="ajaxTest" value="/list.action" /> > <s:tabbedPanel labelposition="left" closeButton="tab" > selectedTab="dynamic" id="test"> > <s:div label="static" id="static"> > This is an static content tab. > </s:div> > <s:div href="%{ajaxTest}" theme="ajax" label="dynamic" id="dynamic"> > </s:div> > </s:tabbedPanel> > </body> > </html> > > Thanks, > Willa > > ----- Original Message ---- > From: Dave Newton <[EMAIL PROTECTED]> > To: Struts Users Mailing List <[EMAIL PROTECTED]> > Sent: Friday, April 13, 2007 10:03:04 AM > Subject: Re: [S2] Cannot run TabbedPanel tag > > > --- Minerva CC <[EMAIL PROTECTED]> wrote: >> <%@ taglib prefix="s" uri="/struts-tags"%><s:url >> id="ajaxTest" value="/AjaxTest.action" >> /><s:tabbedPanel labelposition="left" >> closeButton="tab" selectedTab="dynamic" >> id="test"><s:div label="static" id="static">This is >> an static content tab.</s:div><s:div >> href="%{ajaxTest}" theme="ajax" label="dynamic" >> id="dynamic">This is a dynamic content tab. The >> content of this div will be replaced with the text >> returned from >> "/AjaxTest.action"</s:div></s:tabbedPanel> >> But, when I run it I got an error that the attribute >> id is required for the TabbedPanlel. So, I added a >> id and run it again. Then, it populated a page with >> the text strings, but no tabs. When I view the >> source code, I can see the following code has been >> generated: > > Do you have the <s:head theme="ajax"/> on your page? > > Also, as general rule, you should generate well-formed > HTML. In other words, create a complete HTML page, not > just a JSP fragment, if you are dispatching directly > to a JSP. > > d. > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com Ahhh...imagining that irresistible "new car" smell? Check out new cars at Yahoo! Autos. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com