Re: Substitution for Switch/Case/Block to embed components really dynamic ?
you have to wrap your components in a block... as done by the beaneditor and inject them as examplified by thiago. this way your target page does not have to know anything about the wrapped components. i did something similar by introducing an own block service. which i contribute blocks from different pages (page / block id pairs). a page that should display different combinations of blocks just injects this block service and displays the blocks... if a block does not exist an empty block is displayed. g, kris Ulrich Stärk u...@spielviel.de 04.09.2009 14:33 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: Substitution for Switch/Case/Block to embed components really dynamic ? No. That's the drawback of the caching of pages and their component structure done by Tapestry. Uli On 04.09.2009 13:56 schrieb Stefan: I think Its the right direction, but there is always the main problem: How to get and add a component which is not defined/bound in any page template? Is that possible at all? Am 04.09.2009 um 01:43 schrieb Thiago H. de Paula Figueiredo: BeanEditor and BeanEditForm use blocks from different pages to edit properties. Its something similar to what you want to do. Ultimately, they get a block from a given page using this code (adapted from BeanBlockOverrideSourceImpl.toBlock()): Page page = pageCache.get(pageName); return page.getRootElement().getBlock(blockId); where pageCache is an instance of RequestPageCache. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Substitution for Switch/Case/Block to embed components really dynamic ?
I think Its the right direction, but there is always the main problem: How to get and add a component which is not defined/bound in any page template? Is that possible at all? Am 04.09.2009 um 01:43 schrieb Thiago H. de Paula Figueiredo: BeanEditor and BeanEditForm use blocks from different pages to edit properties. Its something similar to what you want to do. Ultimately, they get a block from a given page using this code (adapted from BeanBlockOverrideSourceImpl.toBlock()): Page page = pageCache.get(pageName); return page.getRootElement().getBlock(blockId); where pageCache is an instance of RequestPageCache. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org smime.p7s Description: S/MIME cryptographic signature
Re: Substitution for Switch/Case/Block to embed components really dynamic ?
No. That's the drawback of the caching of pages and their component structure done by Tapestry. Uli On 04.09.2009 13:56 schrieb Stefan: I think Its the right direction, but there is always the main problem: How to get and add a component which is not defined/bound in any page template? Is that possible at all? Am 04.09.2009 um 01:43 schrieb Thiago H. de Paula Figueiredo: BeanEditor and BeanEditForm use blocks from different pages to edit properties. Its something similar to what you want to do. Ultimately, they get a block from a given page using this code (adapted from BeanBlockOverrideSourceImpl.toBlock()): Page page = pageCache.get(pageName); return page.getRootElement().getBlock(blockId); where pageCache is an instance of RequestPageCache. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Substitution for Switch/Case/Block to embed components really dynamic ?
BeanEditor and BeanEditForm use blocks from different pages to edit properties. Its something similar to what you want to do. Ultimately, they get a block from a given page using this code (adapted from BeanBlockOverrideSourceImpl.toBlock()): Page page = pageCache.get(pageName); return page.getRootElement().getBlock(blockId); where pageCache is an instance of RequestPageCache. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org