You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Firas Adiler <ta...@idigna.com> on 2006/08/10 11:24:34 UTC
@Block, accessing the caller's properties
Hello,
Can a Block-component access the page/component that's calling RenderBlock?
Assume page C contains this call: jwcid="@RenderBlock"
block="ognl:someBlock"
Can someBlock access page C's properties?
Thanks for your time!
</Firas>
RE: @Block, accessing the caller's properties
Posted by Firas Adiler <ta...@idigna.com>.
Robert,
This does offer greater flexibility indeed.
Thanks for the tip!
</Firas>
-----Original Message-----
From: robertz@scazdl.org [mailto:robertz@scazdl.org]
Sent: Thursday, August 10, 2006 4:18 PM
To: Tapestry users
Subject: Re: @Block, accessing the caller's properties
Note that "getInvoker" is a 4.x idiom. If you're using tapestry 3.x, you
want the "getInserter()" method (deprecated in favor of getInvoker in 4.0).
You can also do interesting things like:
<div jwcid="@RenderBlock" block="ognl:block" informalParam1="ognl:foo"/>
and then your block can do something like:
blockComponent.getInvoker() (or getInserter() for
3.x).getBinding("informalParam1").getObject();
Which let's you pass a variety of things around, in interesting manners.
(Eg: passing components to pages, passing "parameters" to pages, etc.)
Robert
> Check out Block's getInvoker() method.
> Try
>
> blockComponent.getInvoker().getPage().getSomePageProperty()
>
> Regards,
> Norbi
>
> Firas Adiler wrote:
>> Hello,
>>
>> Can a Block-component access the page/component that's calling
>> RenderBlock?
>>
>> Assume page C contains this call: jwcid="@RenderBlock"
>> block="ognl:someBlock"
>>
>> Can someBlock access page C's properties?
>>
>>
>> Thanks for your time!
>>
>> </Firas>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>>
>> No virus found in this incoming message.
>> Checked by AVG Free Edition.
>> Version: 7.1.394 / Virus Database: 268.10.8/414 - Release Date:
>> 2006.08.09.
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: @Block, accessing the caller's properties
Posted by ro...@scazdl.org.
Note that "getInvoker" is a 4.x idiom. If you're using tapestry 3.x, you
want the "getInserter()" method (deprecated in favor of getInvoker in
4.0). You can also do interesting things like:
<div jwcid="@RenderBlock" block="ognl:block" informalParam1="ognl:foo"/>
and then your block can do something like:
blockComponent.getInvoker() (or getInserter() for
3.x).getBinding("informalParam1").getObject();
Which let's you pass a variety of things around, in interesting manners.
(Eg: passing components to pages, passing "parameters" to pages, etc.)
Robert
> Check out Block's getInvoker() method.
> Try
>
> blockComponent.getInvoker().getPage().getSomePageProperty()
>
> Regards,
> Norbi
>
> Firas Adiler wrote:
>> Hello,
>>
>> Can a Block-component access the page/component that's calling
>> RenderBlock?
>>
>> Assume page C contains this call: jwcid="@RenderBlock"
>> block="ognl:someBlock"
>>
>> Can someBlock access page C's properties?
>>
>>
>> Thanks for your time!
>>
>> </Firas>
>>
>>
>> ------------------------------------------------------------------------
>>
>> No virus found in this incoming message.
>> Checked by AVG Free Edition.
>> Version: 7.1.394 / Virus Database: 268.10.8/414 - Release Date:
>> 2006.08.09.
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: @Block, accessing the caller's properties
Posted by Firas Adiler <ta...@idigna.com>.
Hello Norbi,
I used this ognl expression: components.MyBlock.invoker.page.someProperty
and it worked like a charm. Thank you!
</Firas>
-----Original Message-----
From: Norbert Sándor [mailto:developer@erinors.com]
Sent: Thursday, August 10, 2006 11:46 AM
To: Tapestry users
Subject: Re: @Block, accessing the caller's properties
Check out Block's getInvoker() method.
Try
blockComponent.getInvoker().getPage().getSomePageProperty()
Regards,
Norbi
Firas Adiler wrote:
> Hello,
>
> Can a Block-component access the page/component that's calling
RenderBlock?
>
> Assume page C contains this call: jwcid="@RenderBlock"
> block="ognl:someBlock"
>
> Can someBlock access page C's properties?
>
>
> Thanks for your time!
>
> </Firas>
>
>
> ----------------------------------------------------------------------
> --
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.10.8/414 - Release Date:
2006.08.09.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: @Block, accessing the caller's properties
Posted by Norbert Sándor <de...@erinors.com>.
Check out Block's getInvoker() method.
Try
blockComponent.getInvoker().getPage().getSomePageProperty()
Regards,
Norbi
Firas Adiler wrote:
> Hello,
>
> Can a Block-component access the page/component that's calling RenderBlock?
>
> Assume page C contains this call: jwcid="@RenderBlock"
> block="ognl:someBlock"
>
> Can someBlock access page C's properties?
>
>
> Thanks for your time!
>
> </Firas>
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.10.8/414 - Release Date: 2006.08.09.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org