Re: T5: Passing a component to layout
can be replaced by . An annoymous block never renders and is used to prevent the rendering of its contents. On Tue, Mar 18, 2008 at 11:40 AM, Martin Kersten <[EMAIL PROTECTED]> wrote: > I hope I am not walking a dead road but here is what I understood: > > 1. You have a side-bar > 2. This side bar displays its content depending on the current page type > 3. You would like to encapsulate your side bar. > > > > Easiest solution I can think of is to dispose your side bar into sub > components and configure your sidebar component within the page: > > page.tml: > > > (show-parameter specifies which sub-components to show) > > sidebar.tml: > > > > > > > > Your Sidebar class must provide a way to parse the show and > to support the property showSearch: > like: > > boolean getShowSearch() { > return show.contains("search"); > } > > This would be a clean and simple approach you might find useful. > > > Cheers, > > Martin (Kersten) > > -Ursprüngliche Nachricht- > Von: Bill Holloway [mailto:[EMAIL PROTECTED] > Gesendet: Dienstag, 18. März 2008 19:20 > An: Tapestry users > Betreff: T5: Passing a component to layout > > > > Sidebars in our application will change from page to page. Normally, I'd > just pass them from the page to the layout as a block defined in the page. > However, some sidebars will have forms whose events I'd like to trap within > the sidebar. Blocks can't do that of course. So I want my sidebar to be a > component that can trap the event. > > I can do this by putting this on my page: > > > ... > > > > ... > > > Then in the page class, I can do @InjectComponent private Sidebar > _pageSpecificSidebar; public Sidebar getMySidebar() {return _mySidebar; }. > Another possibility is to have the in the page template > rather than layout, but I'd rather keep the "sidebar" code in the layout. > > I don't like having to use the statement there to prevent the > rendering of the sidebar in the page. I'm sure there's a better way to do > this. Suggestions? > > Bill > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: T5: Passing a component to layout
I hope I am not walking a dead road but here is what I understood: 1. You have a side-bar 2. This side bar displays its content depending on the current page type 3. You would like to encapsulate your side bar. Easiest solution I can think of is to dispose your side bar into sub components and configure your sidebar component within the page: page.tml: (show-parameter specifies which sub-components to show) sidebar.tml: Your Sidebar class must provide a way to parse the show and to support the property showSearch: like: boolean getShowSearch() { return show.contains("search"); } This would be a clean and simple approach you might find useful. Cheers, Martin (Kersten) -Ursprüngliche Nachricht- Von: Bill Holloway [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 18. März 2008 19:20 An: Tapestry users Betreff: T5: Passing a component to layout Sidebars in our application will change from page to page. Normally, I'd just pass them from the page to the layout as a block defined in the page. However, some sidebars will have forms whose events I'd like to trap within the sidebar. Blocks can't do that of course. So I want my sidebar to be a component that can trap the event. I can do this by putting this on my page: ... ... Then in the page class, I can do @InjectComponent private Sidebar _pageSpecificSidebar; public Sidebar getMySidebar() {return _mySidebar; }. Another possibility is to have the in the page template rather than layout, but I'd rather keep the "sidebar" code in the layout. I don't like having to use the statement there to prevent the rendering of the sidebar in the page. I'm sure there's a better way to do this. Suggestions? Bill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Passing a component to layout
Sidebars in our application will change from page to page. Normally, I'd just pass them from the page to the layout as a block defined in the page. However, some sidebars will have forms whose events I'd like to trap within the sidebar. Blocks can't do that of course. So I want my sidebar to be a component that can trap the event. I can do this by putting this on my page: ... ... Then in the page class, I can do @InjectComponent private Sidebar _pageSpecificSidebar; public Sidebar getMySidebar() {return _mySidebar; }. Another possibility is to have the in the page template rather than layout, but I'd rather keep the "sidebar" code in the layout. I don't like having to use the statement there to prevent the rendering of the sidebar in the page. I'm sure there's a better way to do this. Suggestions? Bill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]