Yes it will inject the component defined in your Activities .tml file.
You have to use the t:id value as your property name though. But if you
don't define a t:id on your component I think the first will have a t:id
value the same as the components name, which in your case is layoutM.
But to be sure you can add the t:id:
<t:layoutM t:id="myLayoutComponent" ... />
@InjectComponent
private LayoutM myLayoutComponent;
Here's some more info on injection in Tapestry:
https://tapestry.apache.org/injection-faq.html
On 22/10/15 12:28, g kuczera wrote:
Hi Nathan,
To be honest, I just want to access the whole LayoutM object in the class,
that uses it. Right now I am able to access Activities' fields from within
<t:layoutM title="${message:site.title} - ${message:page.title}"
bodyClass="dashboard"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
xmlns:p="tapestry:parameter">
<!--here I am accessing the Activities fields and now I want to take/pass
the whole LayoutM's instance object, pass it, to the actually rendered
page, which is Activities -->
<t:block id="successBlock"></t:block>
</t:layoutM>
successBlock is the field from Activities java class. I will try your
advice right away. But I already have a question about
@InjectComponent
private LayoutM layoutM;
Does it mean, that the layoutM, which is being used by Activities page
right now, will be just inflated/injected to the layoutM field? No new
object will be created, because it already, exists. Sorry for questioning
for basics, but I am still learning these new (for me) concepts.
2015-10-22 11:13 GMT+02:00 Nathan Quirynen <nat...@pensionarchitects.be>:
Hey,
I'm not sure I totally understand your question, but if you just want to
access your components properties in your page I think you can do the
following (not tested):
Inject your layout component in your page like following:
@InjectComponent
private LayoutM layoutM;
public Object getSomeProperty() {
return layoutM.getSomeProperty();
}
${someProperty}
Or with the @Property annotation you can access its properties in your
page as following:
@Property
@InjectComponent
private LayoutM layoutM;
${layoutM.someProperty}
Nathan
On 22/10/15 10:48, g kuczera wrote:
Hi Guys,
I have a custom layout named LayoutM (java class and tml). It is used by
my
page - Activities - like that:
<t:layoutM title="${message:site.title} - ${message:page.title}"
bodyClass="dashboard"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
xmlns:p="tapestry:parameter">
<!--a lot of stuff -->
</t:layoutM>
And it implements some kind of interface (class LayoutM implements
CustomInterface).
Is there a way to pass LayoutM java class object,+
to Activities page? Activities page contains the field:
@Parameter(required=false)
private CustomInterface fieldName;
I saw
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/T5-passing-values-between-layout-component-and-page-td2412095.html
but this works in the opposite way.
Is something like that correct (if I put it below "a lot of stuff" line)?
<p:fieldName value=${this}></p:fieldName>
What I can see right now is the "this" being an instance of Activities
class. How can I get the parent layout's object?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org