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 InnerLayout.
Could you clarify the meaning of 'contained'?
I think ComponentResources#getContainer has the best explanation:
"Returns the component which contains this component, or null for the
root component. For mixins, this returns the componet to which the mixin
is attached."
I probably shouldn't have used the word "parent", it's a bit confusing
in this context.
From an html point of view
(and I assume a component tree point of view), the hierarchy of my page is:
Page
+-- Layout
+-- InnerLayout
That is correct.
However, if "Layout is contained in InnerLayout" means "InnerLayout.tml
references Layout.tml" then the 'reference' hierarchy is:
Page
+-- InnerLayout
+-- Layout
Also correct.
Should I be reading "InjectContainer" as
"InjectTheComponentWhoseTemplateContainsTheContentsToBeInsertedAsBody"? If
so, perhaps @InjectContentProvider would be more intuitive?
No, just InjectTheComponentWhoseTemplateContainsThisComponent.
Is there any documentation on @InjectContainer? I've searched the Tapestry
site and Wiki but found nothing.
Here are the relevant docs:
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/InjectContainer.html
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ComponentResources.html#getContainer()
InjectContainer should probably have its description updated to match
ComponentResources#getContainer. I'll file a JIRA issue.
Hope this helps. If not, you know what to do. ;)
-Filip
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]