Hi,
Where is declared your action ? To be able to retrieve the tiles context, there should be a tiles context. There is a tiles context only if you insert an Tiles, or do a forward from an action to a definition. In this later case, the context is created after the action.
Cedric
Affan Qureshi wrote:
I want to modify the Attributes in a tiles Definition from my Action
classes. Is this possible? I have tried the following code inside the Action
class but do not get an Attribute against the name, instead I get a null.
ComponentContext context = ComponentContext.getContext(request);
java.util.List list = (java.util.List)context.getAttribute("tabList");
Is it because it is request scoped? Can i make it session-scoped? Also I get
an empty iterator when I try to traverse the list of attributes in the Tiles
Context.
Iterator iter = context.getAttributeNames();
System.out.println(iter.next())
System.out.print("Printing Attrbutes:");
while(iter.hasNext())
{
System.out.println("Attribute"+ ((String)iter.next()));
}
My tiles definition is given below. Thanks a lot.
----- Original Message -----
From: "Affan Qureshi" <[EMAIL PROTECTED]>
To: "struts-user" <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 1:26 PM
Subject: Nested layouts (Panels inside Tabs)
I have a Tabs Layout setup and inside a tab I have another layout with twoand
panels(menu and content). This is my definition:
<definition name="index.page" path="/webpages/layouts/tabsLayout.jsp" >
<put name="header" value="/webpages/header.jsp"/>
<put name="footer" value="/webpages/footer.jsp" />dfs
<put name="selectedIndex" value="0" />s
<put name="parameterName" value="selected" />
<putList name="tabList" >
<item value="Home" link="/webpages/home.jsp"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
<item value="Template" link="/webpages/template.jsp"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
<item value="Search" link="/webpages/search.jsp"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
</putList>
</definition>
The link to "Template" i.e the template.jsp file follows a simple layout:
<definition name="templateview.default" path="/webpages/layout.jsp">
<put name="menu" value="/webpages/tiles/categoryTile.jsp"/>
<put name="body" value="/webpages/tiles/templateTile.jsp"/>
</definition>
The problem is that when I click on any link inside one of the panels in
templateTile.jsp or any other file, it breaks out of the Tabular layout
displays it as just two panels. This problem can be reproduced if you runyou
the tiles-documentation example and go to
http://localhost:8080/tiles-documentation/examples/tabs.jsp. Now here if
click on any link in the menu the page will open outside the tab layout.
The hyperlinks in my "Menu" panel point to Action classes. I am forwarding
requests from the Action classes to Tiles Definitions.
What should I do to tackle this problem?
Also can anyone guide me to a resource for Nested Tabs?
Thanks for your time.
--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>
-- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

