You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by robinbajaj <ro...@gmail.com> on 2007/08/26 07:10:45 UTC

struts-menu + tiles 1.x + struts 1.x issue

Summary:

====Background:====
I have a web-app using Struts1.x + tiles 1.x.

I am using Struts-menu which is working fine individually (without tiles). I
need advice to insert this Struts-menu based page in my tiles definition. 
( I have followed this thread 
http://www.nabble.com/first-struts-menu-with-tiles-integration-t2105421.html
Struts+tiles integration thread  which provides a starting point for
struts-menu + tiles integration. 

==My requirement is:===
When I click on the any tab of the struts-menu, the corresponding tab's
contents (a tile definition from tiles-defs.xml) should show up below it
(along with rest of the layout of the site like header, footer, etc) 

===My problem :===
But currently when I click on any struts-menu tab, it shows the content
below it, but moves out of the site 's remaining layout i.e header, footer,
sidebar etc. are missing.  I know the reason is how I have defined my tiles
in tiles-defs.xml, but I need suggestion to re-arrange my tiles so that when
the tab is clicked the contents are shown below it , and the struts-menu
component as a whole stays in the remaining sitelayout (ie it shows header,
footer tiles surrounding it..)

My tiles layout (tiles-defs.xml) is as following:
http://rafb.net/p/VKExtH17.html

Basically i have header, footer, sidebar, navigation bar in my
"base.definition" which is defined
in siteLayout.jsp.  Clicking on the appropriate links in the sidebar, I
forward to appropriate tiles-definitions (which point to jsp based forms in
the body section) like "page.welcome" points to index.jsp etc. 

As I said above, my problem occurs when I click on any tab of the
struts-menu component.

My relevant struts-menu menu-config.xml contents are...
http://rafb.net/p/dxBVai74.html

When I click on first menu on my struts-menu it points to this definition in
my menu-config.xml file ----------------
<Menu name="ClinicalPresentationMenu" title="Clinical Presentation"
action="/clinicalPresentationMenu"/>, 
----------------
which invokes the following action mapping is called from my
struts-config.xml file 
----------------
 <action   
		  path="/clinicalPresentationMenu"
		  parameter="roster.ClinicalPresentation"
		  type="org.apache.struts.actions.ForwardAction">
</action>
----------------

which looks for my tile-def named "roster.ClinicalPresentation" in my
tiles-defs.xml

which has the following related definitions...
--------------------------
	<definition name="page.patientRoster" extends="base.definition">
		<put name="title" value="Patient Roster" />
		<put name="body" value="patientRosterBody.definition" type="definition"/>
	</definition>

	<definition name="patientRosterBody.definition"
path="/jsp/PatientRoster_new_layout.jsp">
		<put name="roster_header" value="/jsp/tabbedMenu.jsp" />
		<put name="roster_body" value="/jsp/clinicalPresentation.jsp" />
	</definition>
		
	<definition name="roster.ClinicalPresentation"
extends="patientRosterBody.definition">
		<put name="roster_body" value="/jsp/clinicalPresentation.jsp" />
	</definition>
--------------------------

Since my tile-def named "roster.ClinicalPresentation" extends
"patientRosterBody.definition" 
I just shows the contents of "patientRosterBody.definition" which is
"/jsp/PatientRoster_new_layout.jsp".

I need to somehow link my tab contents with a tile definition that extends
"base.definition" (which
includes header, footer, sidebar etc.) How can i do that ??

Any suggestions are most welcome,

======================================
(In case its helpful, there's some further explanation about the
tiles-defs.xml contents)

Basically my "page.patientRoster" extends my base.definition and puts
another definition
"patientRosterBody.definition" in the <body>. This
"patientRosterBody.definition" is defined 
in PatientRoster_new_layout.jsp which is basically a table with two rows, 
the top row has <tiles:insert attribute="roster_header"/> 
and 
bottom row has   <tiles:insert attribute="roster_body"/>.

"roster_header" is my tabbedMenu.jsp (containing Struts-menu) and bottom row
containing
"roster_body" is supposed to show the jsp content, depending upon which tab
is clicked in the roster_header (i.e struts-menu) . I intend to have
tile-defs corresponding to all my struts-menu tabs
pointing the tab contents (different jsps).

In this case, I have "roster.ClinicalPresentation" which inserts
"jsp/clinicalPresentation.jsp" as "roster_body".

My "/jsp/tabbedMenu.jsp" content are here:
http://rafb.net/p/6aX5Ub29.html

My "/jsp/PatientRoster_new_layout.jsp" contents are here:
http://rafb.net/p/B7Ipil28.html
======================================


-- 
View this message in context: http://www.nabble.com/struts-menu-%2B-tiles-1.x-%2B-struts-1.x-issue-tf4330085.html#a12332219
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org