You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Long <su...@sbcglobal.net> on 2005/02/21 07:19:14 UTC

RE: Tiles scope headache assistance still needed.

I am still no closer to a solution to my problem with tiles.  I will explain
the scenario again in hopes that someone will provide some insight into my
problem.

I am using tiles to provide layouts in my xml syntax JSP pages.  

Here is the original page that I want to use within a <c:forEach> tag.  I
attempt to add my layout to decorate the quote, but no matter what I do I
cannot make the quote available to my subtile.  My quoteForm is in session
scope.  I can see the power of tiles, but I thought I could give access of
beans to my subtiles.  No matter where I place my <tiles:importAttribute/>
it has no effect.  What am I missing something?  

<!--  Original page  --> 
<c:forEach var="quote" items="${quoteForm.quoteValues}">
   <table>
      <tr>
        <td>${quote.offerPriceLightValue.sizeValue.size}"/></td>
      </tr>
    </table>
    <tiles:insert definition=".quote.list.item" flush="false">
      <tiles:put name="quote" beanName="quote"/>
    </tiles:insert>
</c:forEach>


Instead of putting the layout code in the page I want to wrap the quote with
a layout my designer created.
<!--  Tile added to apply layout page  --> 
<c:forEach var="quote" items="${quoteForm.quoteValues}">
    <tiles:insert definition=".quote.list.item" flush="false">
      <tiles:put name="quote" beanName="quote"/>
    </tiles:insert>
</c:forEach>

I create the following definintion that extend my layout so I can wrap my
qutoe.
<!-- tiles definition  -->
<definition extends=".table.holder" name=".quote.list.item">
  <put name="title" value="Test Box"/>
  <put name="content"
value="/WEB-INF/jsp/tiles/actions/quote/list.item.jsp"/>
</definition>

Here is a simplified quote display that I would like to include as the
content for my quote.
<!--  Quote template page list.item.jsp  --> 
<tiles:importAttribute/>
<table>
  <tr>
    <td>${quote.offerPriceLightValue.sizeValue.size}"
    </td>
  </tr>
</table>

This is a simplified layout that I need to use to decorate the quote.
<!-- table.holder.1 layout .quote.list.item extends to get decoration -->
<table>
  <tr>
    <td><tiles:getAsString name="title"/></td>
  </tr>
  <tr>
    <td>"><tiles:insert attribute="content" ignore="true"/></td>
  </tr>
</table>

Thank you for your time, 

Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com 

-----Original Message-----
From: Jason Long [mailto:supernovasoftw2683@sbcglobal.net] 
Sent: Saturday, February 19, 2005 3:59 PM
To: 'Struts Users Mailing List'
Subject: RE: Tiles scope headache assistance needed.

quote.list.item is defiened as follows:

  <definition extends=".table.holder" name=".quote.list.item">
    <put name="title" value="Test Box"/>
    <put name="content"
value="/WEB-INF/jsp/tiles/actions/quote/list.item.jsp"/>
  </definition>

".table.holder" is a layout.  I want to display my quote in this holder.
The format for the quote is defined in list.item.jsp.  Everything works
except I cannot make quote available to the tile.   

"quote" is defined as follows <c:forEach var="quote"
items="${quoteForm.quoteValues}">

"quoteForm" is in session scope.

Thank you for your time, 

Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com 

-----Original Message-----
From: Brian Moseley [mailto:bcm@maz.org] 
Sent: Friday, February 18, 2005 11:34 AM
To: Struts Users Mailing List
Subject: Re: Tiles scope headache assistance needed.

Jason Long wrote:

> <c:forEach var="quote" items="${quoteForm.quoteValues}">
>    <!-- no tile used --> 
>    <table>
>       <tr>
>         <td>${quote.offerPriceLightValue.sizeValue.size}</td>
>       </tr>
>     </table>
>     <!-- tile attempt to wrap with holder for delineation -->
>     <tiles:insert definition=".quote.list.item" flush="false">
>       <tiles:put name="quote" beanName="quote"/>
>     </tiles:insert>
>   </c:forEach>
> 
> I would like to define the following tile definition:
> 
> <definition extends=".table.holder" name=".quote">
>   <put name="content" value="/quote.jsp"/>
>  </definition>

you must be leaving something out of your email, cos this 
tile is named .table.holder, but the jsp above is inserting 
a tile named ".quote.list.item".

> And have quote.jsp as follows:
> 
> <table>
>   <tr>
>     <td>${quote.offerPriceLightValue.sizeValue.size}</td>
>   </tr>
> </table>

you need to put the <tiles:importAttribute> in quote.jsp. 
that exposes the bean referenced by <tiles:put> in the 
calling jsp.

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




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




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