Sorry, forgot about the list filtering attachments: http://www.markjstang.com/tapestry/
regards, Mark -----Original Message----- From: Mark Stang Sent: Thu 6/1/2006 3:57 PM To: Tapestry users Subject: RE: Border question Andreas, Here is an excerpt from Frame.html: <!--This is our headcrumbs and breadcrumbs, which we don't show if it is the portal page.--> <span jwcid="@contrib:FormConditional" condition="ognl:! page.visit.currentTasklet.isItPortal()"> <span jwcid="@contrib:FormConditional" condition="ognl:! page.visit.currentTasklet.isPostInstallWizard()"> <div class="headcrumbs" NOWRAP><span jwcid="@HeadCrumbs"/></div> </span> <div class="breadcrumbs"><span jwcid="@BreadCrumbs"/></div> </span> <!-- common errors for every page --> <span jwcid="validationErrors"/> <!-- Notes for each page --> <span jwcid="@contrib:FormConditional" condition="ognl:page.visit.currentState.isShowNote()"> <div class="messagetext"><img src="images/notes_icon.gif" width="12" height="12" border="0"> <span jwcid="@Insert" raw="true" value="ognl:note"/> </div> </span> <!-- the Tapestry compenent that swaps out components --> <span jwcid="@TaskletView"/> TaskletView.java: This implementation of renderComponent(), gets a component from another page and calls render on it. We use a single "holder" page that has instances of all 130 components. In Tapestry you can get a component from another page and display it in the current page. So, our page stays the same, but the one component in the middle swaps in and out. import org.apache.tapestry.AbstractComponent; public abstract class TaskletView extends AbstractComponent { protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { Tasklet tasklet = ((Visit)getPage().getVisit()).getCurrentTasklet(); TaskletState ts = (TaskletState)tasklet.getCurrentState(); String pageForCard = ts.getPageName(); IPage cardPage = cycle.getPage(pageForCard); String cardName = tasklet.getCurrentState().getStateName(); BaseComponent component = (BaseComponent)cardPage.getComponent(cardName); if (component instanceof PageRenderListener) { IPage page = component.getPage(); page.beginPageRender(); } component.render(writer, cycle); } } I have attached a sample screen (snapshot7). The Headcrumbs start with Main. The Breadcrumbs have checkmarks besides them. The note is in green. Everything between the green note and the buttons is component. In snapshot8, the headcrumbs and breadcrumbs have changed because we are in a different part of the application. Everything between the green note and the buttons is the component. Each of these components are just standard Tapestry components. The headcrumbs and breadcrumbs are each tapestry components that redraw themselves every time we change screens. Cheers, Mark -----Original Message----- From: Andreas Bulling on behalf of Andreas Bulling Sent: Thu 6/1/2006 3:08 PM To: Tapestry users Subject: Re: Border question Hi Mark, sounds as a solution even if I don't understand what you were trying to explain... Some sample code would help a lot, is there something you can show us/commit to one of the widely known Tapestry repositories? Cheers, Andreas On 01. Jun 2006 - 14:51:00, Mark Stang wrote: | There is another option to get around that restriction. It is what Howard calls my "mutant" application. I have one Frame.html/Frame.page/Frame.java. All of my other pages are popups. There are about 5 or 6 of those. In addition, I have 130 "components". None of my components have any border content, it is all in the "Frame". As part of the Frame I have Breadcrumbs and something we call Headcrumbs. Headcrumbs are a higher level menu. So, we can have a bunch of "breadcrumbs" within each headcrumb. Headcrumbs are a group of "breadcrumbs". Breadcrumbs are reusable across multiple Headcrumbs. Any one breadcrumb knows nothing about any of its fellow breadcrumbs in a headcrumb. | | Basically, we have a wizard application with 130 screens. | | The border component replaces pages, we have one page that replaces components. There is an age-old Tapestry question about whether you create components or pages? What is your level of re-use? We chose re-use at the level of components. | | regards, | | Mark --------------------------------------------------------------------- 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]