> I used T4 for a short period a long time ago, so I'm not understanding > the parallels that you are making. Can you describe the workflow that > you are shooting for? I'm not clear why you'd remove the breadcrumb in > the activate event and the add it again the beginrender event.
beginRender will : create a bookmarkable link : store (if necessary) in the model of breadcrumbs. onActivate gets called whenever a breadcrumb - rendered as link is clicked and will : remove a crumbs that are listed after the clicked link, cleaning up the trail I think the workflow is okay - as it is proven in T4. I'm just looking for the correct points to hook it into T5. Thx, -J. > > > Josh > > On Wed, Apr 23, 2008 at 8:19 AM, Jan Vissers <[EMAIL PROTECTED]> > wrote: >> Hi, >> >> Need some advice. In T4 I had a breadcrumb component that got its >> information from a breadcrumb model structure. Each page that needed to >> go >> onto the crumb path would implement some base page class. This page >> class >> implemented PageRenderListener and IExternalPage. The former to add info >> to the model and the latter to remove info from the model (btw the >> breadcrumb model was an ASO). >> >> Basically the model consisted of some key, name/title and (constructed) >> link tuple. The link basically pointed to an IExternalPage implemented >> page class - so to be precise the whole breadcrumb path consisted of >> bookmarkable pages. >> >> I'm trying to mimic this behavior with T5, using the BeginRender >> annotation on a basepage class method called initPage() and also on the >> basepage class a onActivate() method. I have some questions about it. >> Below the specific base page code: >> >> protected String getBreadCrumbTitle() { >> return resources.getMessages().get("title-" + >> resources.getPageName().toLowerCase()); >> } >> >> protected Object[] getLinkParameters() { >> return null; >> } >> >> @BeginRender >> public void initPage() { >> String pageName = resources.getPageName(); >> Link link = resources.createPageLink(resources.getPageName(), >> true, getLinkParameters()); >> breadCrumbHolder.checkBreadCrumbForAdd(pageName, >> getBreadCrumbTitle(), link.toRedirectURI()); >> } >> >> public void onActivate() { >> String pageName = resources.getPageName(); >> breadCrumbHolder.checkBreadCrumbForRemove(pageName); >> } >> >> Q1: the initPage() method is there to create a 'bookmarkable' link - >> amongst others - and store that information in the breadcrumb model. The >> getLinkParameters() is there for a subclass to provide its specific >> activation parameters to be used. Should I use another way to create >> bookmarable links? >> >> Q2: the onActivate() method is there to remove one (or more) crumbs from >> the crumbpath. Since other pages will also need activation - potentially >> with additional arguments - is this onActivate() the best way/place to >> manipulate the model? I'm getting the idea that onActivate() is not the >> designated alternative for T4's activateExternalPage(Object[] >> parameters, >> IRequestCycle cycle) in IExternalPage interface. >> >> Currently all of this works - although haven't tested activation with >> activation context parameters yet. >> >> Thx. >> -J. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > -- > -- > TheDailyTube.com. Sign up and get the best new videos on the internet > delivered fresh to your inbox. > > --------------------------------------------------------------------- > 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]