I'm still stuck on this. Can anyone help?

Have tried as suggested using a tile as the 'value' of a put.

Here are the definitions from tiles-defs:
    
<definition name="master" path="/layout/master_layout.jsp">
</definition>

<definition name="search_base" path="/layout/search_layout.jsp" />

<definition name="search_form" extends="master">
<put name="body" value="search_base" />
<put name="form" value="/pageComponents/form.jsp" />
</definition>

<definition name="search_results" extends="master">
<put name="body" value="search_base" />
<put name="form" value="/pageComponents/form.jsp" />
<put name="results" value="/pageComponents/results.jsp" />
</definition>

I hope it's clear here what I'm trying to do although in this case it's
fairly trivial.

To the user there are two pages: a search page and a results page.
Both pages have the search form and the second also has results.

This is only a simplification as an example. The real situation is more
complicated but the principle is the same.

In the above example when the user first requests the search page I want to
forward to a tile that inserts just the form onto the page. Then when the
form is submitted I want to forward to a tile that also inserts the results.

I have tried to do this with the tiles 'search_form' and 'search_results'.
They both extend the master tile, but take the generic 'search_base' tile as
body. I am then putting the extra parts that the 'search_base' will need.

But struts returns:

ServletException in '/layout/search_layout.jsp': Error - Tag Insert : No
value found for attribute 'form'.

Here is /layout/master_layout.jsp

<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"; prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"; prefix="tiles"
%>

<html:html>
<head>
</head>
<body>
<tiles:insert attribute="body" />
</body>
</html:html>

Here is /layout/search_layout.jsp

<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"; prefix="tiles"
%>
<table width="100%">
<tr><td><tiles:insert attribute="form" /></td></tr>
<tr><td><tiles:insert attribute="results" ignore="true" /></td></tr>
</table>

Thanks in advance.

-----Original Message-----
From: Leahy, Kevin [mailto:[EMAIL PROTECTED] 
Sent: 10 November 2005 00:21
To: 'Struts Users Mailing List'
Subject: RE: Tiles: nesting one template inside another?

Are you saying that the 'put' tag can take a another tile as its 'value'
attribute? I think this could be the answer, but I haven't noticed this in
the documentation - does anyone know of any examples online?
 

-----Original Message-----
From: Paul Benedict [mailto:[EMAIL PROTECTED]
Sent: 10 November 2005 00:00
To: Struts Users Mailing List
Subject: RE: Tiles: nesting one template inside another?

Kevin,

Follow this example. It uses a master layout [A] and then an inner layout
[B]. You need to envision that the body content of A is B, and the body
content of B is C.

<definition name="search_form_base" path="/layout/search_form_layout.jsp">
<-- A
        <put name="FilterA" value="/pageComponents/FilterA.jsp" />
        <put name="FilterB" value="search_form_view" /> <-- B </definition>

<definition name="search_form_view" path="/pageComponents/FilterB.jsp">  <--
B
        <put name="Button1" value="/pageComponents/Button1.jsp" />  <-- C
</definition>

--- "Leahy, Kevin" <[EMAIL PROTECTED]> wrote:

> Thanks for reply. But I'm not sure I really understand what you're 
> suggesting.
> What I really want is a way of something like this:
> 
> The base layout contains the menu and logo of company etc It has 
> inside it a tiles insert for the body so that other tiles can add 
> whatever body they want inside.
> 
> <definition name="cam.base" path="/layout/base_layout.jsp"> 
> </definition>
> 
> Search form layout contains various filtering gadgets for the form and 
> then some optional buttons and other gadgets that change slightly 
> according to where the form is being used. E.g. in the edit view of 
> the form you will have an 'update' button. In the search view of the 
> form a 'search' button etc.
> <definition name="search_form_base" path="/layout/search_form_layout.jsp">
>       <put name="FilterA" value="/pageComponents/FilterA.jsp" />
>       <put name="FilterB" value="/pageComponents/FilterB.jsp" /> 
> </definition>
> 
> Here I want to use the base form layout with an extra button.
> <definition name="search_form_view" extends="search_form_base">
>       <put name="Button1" value="/pageComponents/Button1.jsp" /> 
> </definition>
> 
> At the moment I have cut and pasted the base_layout into the 
> search_form_layout. But I'm sure there must be a way of not 
> duplicating this code.
> 
> Can anyone help with this?
> 
> Thanks in advance.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf 
> Of Yujun Liang
> Sent: 09 November 2005 12:30
> To: Struts Users Mailing List
> Subject: Re: Tiles: nesting one template inside another?
> 
> Yes, you can use Layout B, just let xx be empty and yy be the content 
> when showing layout A.
> 
> Regards
> 
> On 11/9/05, Leahy, Kevin <[EMAIL PROTECTED]> wrote:
> >
> > I have a generic company layout mainly composed of the menu 
> > navigations system.
> >
> > I have also a 'Search' type form. The search form will be used in 
> > various different tiles because it is relevant to View, Edit, 
> > Update, Save etc functionality.
> >
> > What I want to do is kind of nest the Search Form layout inside the 
> > generic company layout so that in my tiles definitions file I keep 
> > the generic company part and still inject other tiles into the Form
part.
> >
> > I have a generic layout A :
> >
> > <html>
> > <head>
> > <title><tiles:getAsString name="title" /></title> </head> <body> 
> > <tiles:insert attribute="content" /> <script 
> > language="JavaScript">buildMenus();</script>
> > </body>
> > </html>
> >
> > All pages will use this layout.
> > But I also have a Search form that will be used in many pages: view, 
> > edit, save etc.
> >
> > The form consists of many common elements and will change only 
> > slightly according to context. At the moment I have implemented this 
> > using a separate layout manager which is a cut and paste of layout A 
> > but with other tiles inserts.
> >
> > <html>
> > <head>
> > <title><tiles:getAsString name="title" /></title> </head> <body> 
> > <form> <tiles:insert attribute="xx" /> <tiles:insert attribute="yy"
> > /> </form> <script language="JavaScript">buildMenus();</script>
> > </body>
> > </html>
> >
> > But it seems that I should be able to define a the form as a layout 
> > and use the generic layout as a starting point and inject the tiles 
> > into the form layout.
> >
> > Am I just missing something obvious in the documentation? Or has 
> > anyone done something similar?
> >
> > Many thanks
> >
> > Kevin
> > ------
> >
> >
> >
> > --------------------------------------------------------------------
> > --
> > ---------- The information contained herein is confidential and is 
> > intended solely for the addressee. Access by any other party is 
> > unauthorised without the express written permission of the sender.
> > If you are not the intended recipient, please contact the sender 
> > either via the company switchboard on +44 (0)20 7623 8000, or via 
> > e-mail return. If you have received this e-mail in error or wish to 
> > read our e-mail disclaimer statement and monitoring policy, please 
> > refer to http://www.drkw.com/disc/email/ or contact the sender. 3167
> >
> > --------------------------------------------------------------------
> > --
> > ----------
> >
> >
> >
> 
> 
> --
> Yujun Liang
> [EMAIL PROTECTED]
> 
> 
> ----------------------------------------------------------------------
> ---------- The information contained herein is confidential and is 
> intended solely for the addressee. Access by any other party is 
> unauthorised without the express written permission of the sender. If 
> you are not the intended recipient, please contact the sender either 
> via the company switchboard on +44 (0)20 7623 8000, or via e-mail 
> return. If you have received this e-mail in error or wish to read our 
> e-mail disclaimer statement and monitoring policy, please refer to 
> http://www.drkw.com/disc/email/ or contact the sender. 3167
> ----------------------------------------------------------------------
> ----------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



        
                
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 ------


----------------------------------------------------------------------------
----
The information contained herein is confidential and is intended solely for
the addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient,
please contact the sender either via the company switchboard on +44 (0)20
7623 8000, or via e-mail return. If you have received this e-mail in error
or wish to read our e-mail disclaimer statement and monitoring policy,
please refer to http://www.drkw.com/disc/email/ or contact the sender. 3167
----------------------------------------------------------------------------
----


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 ------


--------------------------------------------------------------------------------
The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender. 3167
--------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to