Re: [T5] Injecting page into nested layouts

2008-08-19 Thread Richard Hoberman
. -- View this message in context: http://www.nabble.com/-T5--Injecting-page-into-nested-layouts-tp19028771p19046282.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL

Re: [T5] Injecting page into nested layouts

2008-08-19 Thread Filip S. Adamsen
Hi, You're right - casting componentResources#getPage works fine. ComponentResources is your friend. :) @InjectContainer does indeed inject the parent of the component. For InnerLayout this is the page alright, but for Layout it's actually the InnerLayout because Layout is contained in

[T5] Injecting page into nested layouts

2008-08-18 Thread Richard Hoberman
InnerLayout extends BaseComponent { @InjectContainer @Property private BasePage page; //etc } -- View this message in context: http://www.nabble.com/-T5--Injecting-page-into-nested-layouts-tp19028771p19028771.html Sent from the Tapestry - User mailing

Re: [T5] Injecting page into nested layouts

2008-08-18 Thread Filip S. Adamsen
Hi, Your BasePage should be in the base subpackage, that's test.base in your case. What happens is that Tapestry tries to cast BasePage to Component, which fails because it hasn't been enhanced by Tapestry - this only happens for components in the base, components, and page subpackages.

Re: [T5] Injecting page into nested layouts

2008-08-18 Thread Filip S. Adamsen
Hi, Looking over your code again I just noticed something's amiss. Where's the Java code for the Layout class? You seem to have posted the InnerLayout class twice. Anyhow, I think I've figured out what's really going on. Your using InjectContainer in Layout, but that doesn't inject the

Re: [T5] Injecting page into nested layouts

2008-08-18 Thread Richard Hoberman
://www.nabble.com/-T5--Injecting-page-into-nested-layouts-tp19028771p19034207.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [T5] Injecting page into nested layouts

2008-08-18 Thread Filip S. Adamsen
Hi again, That's a typo. The Layout class name should read 'Layout' and not 'InnerLayout' but the relevant code is the same. Ah, okay. A potential solution would be to use ComponentResources#getPage to get your page in a getter and just use that in your layout. Unfortunately, that won't