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.
That's my (more or less informed) guess having checked the source of
InjectContainerWorker, anyhow.
-Filip
On 2008-08-18 12:14, Richard Hoberman wrote:
Hi
I'm getting the following exception:
Component TestPage:innerlayout is not assignable to field
test.components.Layout.page (of type test.BasePage).
The skeletons for my components are below. Essentially, my page has an
(inner) layout, which in turn has an (outer) layout. I try to inject the
page into both (inner and outer) layouts.
The page is successfully injected into the inner layout, but the outer
fails. @InjectContainer seems to be selecting the wrong component in this
case. It makes no difference if I remove the injection for the inner layout
(so it doesn't seem to be a conflict).
Should this work?
Richard Hoberman
Page template:
-----------------
<html t:type="InnerLayout" ...>
//page contents
</html>
Inner layout template:
--------------------------
<html t:type="Layout" ...>
//inner layout markup including <t:body />
</html>
Layout template:
--------------------
<html ...>
//layout markup including <t:body />
</html>
Inner Layout class:
----------------------
public class InnerLayout extends BaseComponent {
@InjectContainer
@Property
private BasePage page;
//etc
}
Layout class:
---------------
public class InnerLayout extends BaseComponent {
@InjectContainer
@Property
private BasePage page;
//etc
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]