Well, in 2.2 I make sure that the engine property is set earlier, so that in your component's finishLoad() method, you can reference the engine.
There's a PageDetachListener but no PageAttachListener. You can try and leverage the PageRenderListener interface. ----- Original Message ----- From: "Craig Miskell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 25, 2002 7:29 PM Subject: [Tapestry-developer] [Newbie] Components, engines, visits > Hi, > I'm using Tapestry 2.1, and am just coming over from WebObjects. > As such, I may very well have some incorrect notions about how to do > things. I'm open to both a technical solution to my problem, or a > philosophical one if I've missed something fundamental about Tapestry. > > I have a component, which is to be used in several places, but which has a > large amount of functionality in it. I'm using the Application facade > design pattern, (sorry, can't find url at the moment) where the Tapestry > component or page delegates most data formatting/state to a "facade" > object. THe component/page is solely responsible for rendering. The > facade object then uses the underlying business logic to perform > appropriately. So far the design of that seems to work really well, and > I found it remarkably easy to port a chunk of WebObjects code written in > this style, to Tapestry. I barely had to touch the facade object (other > than to munge it to not use EOF :-( ). > One serious advantage of this is that the facade contains all the > persistent state required for the page/component, so it is the only object > that needs to be recorded by the page recorder (quite convenient really). > > My problem stems not from pages and facades (seems to work well so far), > but components. The facade of this big component I'm developing needs > access to the Visit object, in order to determine the logged in user > (among other things). I can get that from the engine of the page > (this.getPage().getEngine().getVisit()), *once* the engine has been > attached to the page. > > I can't lazily create my facade during render, because then I can't make > it part of the persistent state. However, a component seems to have no > way of knowing when it's page gets attached to an engine. > > So, to summarise: > I have a component which needs to know the engine it's page is attached > to, at some time prior to render time. > > Anyone got any suggestions? > > Thanks, > > Craig Miskell > Programmer, Black Albatross, Otago University, New Zealand > -----BEGIN GEEK CODE BLOCK----- > Version: 3.1 > GCS d- s+:- a-->? C++++(++)$ ULXH+++$>++++ P+>++++ L++$>++++$ E--- W+++$ > N+ K? w--- !O M-- V? PS--- PE Y t++ 5 X+++ R-- tv+ b+>+++ DI++++ D+ G+ e++ > h--- r+++ y+++ > ------END GEEK CODE BLOCK------ > > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Tapestry-developer mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/tapestry-developer > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Tapestry-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/tapestry-developer
