Property expressions are rooted on the instance corresponding to the template.

So you could define a getRowsPerPage() property in Index.java and
reference it in your template:

<div t:type="xy/somecomponent" rowsPerPage="prop:rowsPerPage" source="xyz"/>

Then you could pass the same property to some other component and they
would stay syncrhonized:

<div t:type="xy/othercomponent" rowsPerPage="prop:rowsPerPage"/>

So the page "drives down" values into its embedded components.

If you want a more coherent answer, ask a more coherent question, such
as "my page needs to synchronize the parameters of two seperate
components" or even "I need this same value used in several places in
my page".  Often when you ask for a specific technical question about
an API the best you can get is an answer about the API, not a solution
to your real problem.

On Wed, Aug 17, 2011 at 9:28 AM, locoder <g_u...@hotmail.de> wrote:
> Hi guys,
> im new to tapestry 5 and have a question which maybe is easy for you.
>
> I have a component on a *index * page like this.
> <div t:type="xy/somecomponent" <b>rowsPerPage="4"* source="xz/>
>
> My Question:
> Is it possible to get the attribute rowsPerPage in my index.java, althouth
> its a different component?
>
> I already did this in setupRender:
>
> final Component comp = source.getComponent("ViewGroup");
>                this.test =
> comp.getComponentResources().getEmbeddedComponent("someComponent").getComponentResources().getEmbeddedComponent("someLoop").getComponentResources().getBlockParameter("rowsPerPage").toString();
>
> this gives me:
>
> Block[Renderable[4]]
>
> Is there an easier way to get the number 4?
>
> Thanks in advance,
>
> Locoder
>
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/get-component-attribute-tp4708958p4708958.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to