You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Garner, Shawn" <sh...@pearson.com> on 2005/11/22 23:22:03 UTC

[tiles]

There are ways to put content into a tile but there isn't a way to remove a
tile.

Say we have a layout that has a menu by default then you extend that layout
and you don't want a menu.

I know struts-templates didn't work if you did a put on a blank value.

Does this work with tiles?  Why isn't there a remove or delete tag?

 

Shawn

 


**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

Re: [tiles]

Posted by Greg Reddin <gr...@apache.org>.
On Nov 22, 2005, at 4:22 PM, Garner, Shawn wrote:

> I know struts-templates didn't work if you did a put on a blank value.
>
> Does this work with tiles?

Hmm, I don't know.  Try it and see what happens.  I suspect it won't  
work.  The  only thing I can think of right now is to include a blank  
JSP but that's a terrible way to have to do it.

> Why isn't there a remove or delete tag?

I've personally never thought of that.  I'd be in favor of making an  
attribute optional, so that you can specify that it won't be  
displayed.  We could accomplish it through the XML defs or through a  
JSP tag.

Greg


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


Re: [tiles]

Posted by Craig McClanahan <cr...@apache.org>.
On 11/22/05, Garner, Shawn <sh...@pearson.com> wrote:
>
> There are ways to put content into a tile but there isn't a way to remove
> a
> tile.
>
> Say we have a layout that has a menu by default then you extend that
> layout
> and you don't want a menu.


Instead of thinking about removing tiles from a layout, I would suggest
thinking about your hierarchy the other way around. Build a layout that does
not have the menu, and another layout (extending the previous one) that does
have a menu. Now, for any particular tile, choose the correct layout to
extend based on whether you want the menu or not.

Craig

Re: [tiles]

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/22/05, Greg Reddin <gr...@apache.org> wrote:
>
> So it does work.  How do you use the menubar definition in the JSP
> page?  Are you using the "insert" tag?
>

I had to go look.  Yes:  <tiles:insert attribute="menubar"/>

Don't take it as a recommendation-- all I'm going to say is "it
works".  This is out of my very first Struts app which launched days
after Struts 1.1 went final... no doubt I'd do things a little
differently now. :)

--
Wendy

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


Re: [tiles]

Posted by Greg Reddin <gr...@apache.org>.
On Nov 22, 2005, at 4:42 PM, Wendy Smoak wrote:

> I have that exact situation where I don't want the menu showing up on
> a resolution screen.  I'm doing it in tiles-defs.xml,  so this may not
> apply, but it works:
>
> <tiles-definitions>
>   <definition name="masterPage" path="/WEB-INF/jsp/layout/ 
> basicLayout.jsp">
>      <put name="title"       value="IRM Web" />
>      <put name="menubar"     value="/WEB-INF/jsp/menubar.jsp" />
>      <put name="footer"      value="/WEB-INF/jsp/footer.jsp" />
>      ...
>   </definition>
>
>   <definition name="resolution.page" extends="masterPage">
>     <put name="heading"     value="Resolution" />
>     <put name="menubar"     value="" />
>     <put name="body"        value="/WEB-INF/jsp/resolutionBody.jsp" />
>   </definition>
> ...
>

So it does work.  How do you use the menubar definition in the JSP  
page?  Are you using the "insert" tag?

Greg


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


Re: [tiles]

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/22/05, Garner, Shawn <sh...@pearson.com> wrote:

> There are ways to put content into a tile but there isn't a way to remove a
> tile.
>
> Say we have a layout that has a menu by default then you extend that layout
> and you don't want a menu.

I have that exact situation where I don't want the menu showing up on
a resolution screen.  I'm doing it in tiles-defs.xml,  so this may not
apply, but it works:

<tiles-definitions>
  <definition name="masterPage" path="/WEB-INF/jsp/layout/basicLayout.jsp">
     <put name="title"       value="IRM Web" />
     <put name="menubar"     value="/WEB-INF/jsp/menubar.jsp" />
     <put name="footer"      value="/WEB-INF/jsp/footer.jsp" />
     ...
  </definition>

  <definition name="resolution.page" extends="masterPage">
    <put name="heading"     value="Resolution" />
    <put name="menubar"     value="" />
    <put name="body"        value="/WEB-INF/jsp/resolutionBody.jsp" />
  </definition>
...

--
Wendy

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