You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by revprez <re...@correlatesystems.com> on 2011/05/09 04:23:15 UTC

Triggering zone updates external to the event trigger's container...

Trying to understand if the following is possible, and if not why.

Say I have a component Foo that defines an action link on a zone rendered by
component Bar.

Foo.tml:
...
<t:actionlink t:id="GoUpdateSomething" zone="somethingToUpdate">Go Update
Somthing</t:actionlink>
...

Bar.tml:
...
<t:zone t:id="somethingToUpdate">${value}</t:zone>
...

And in Foo.java:

@Property private int value = 0;
@InjectComponent Zone somethingToUpdate;
...
public Object onActionFromDoSomething {
	value++;
	return somethingToUpdate.getBody();
}

I receive an error noting that Foo does not define a component Bar.

My understanding is that neither components Foo nor Bar have any knowledge
of components
rendered within one another (the attribute t:id) is not global.  I therefore
infer that 
component communication occurs only when they coincide within the same
immediate container
and one component is child to the other.  Is this correct?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Triggering-zone-updates-external-to-the-event-trigger-s-container-tp4380935p4380935.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Triggering zone updates external to the event trigger's container...

Posted by Geoff Callender <ge...@gmail.com>.
Yes, it's really the job of the containing component to coordinate Foo and Bar. See if this helps - it's a page which coordinates PersonList and PersonEditor:

	http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud

Geoff

On 09/05/2011, at 1:03 PM, Thiago H. de Paula Figueiredo wrote:

> On Sun, 08 May 2011 23:23:15 -0300, revprez <re...@correlatesystems.com> wrote:
> 
>> Say I have a component Foo that defines an action link on a zone rendered by component Bar.
> 
> Components are supposed to be self-contained, so having one component updating a zone inside another one is not recommended at all.
> 
>> I receive an error noting that Foo does not define a component Bar.
>> My understanding is that neither components Foo nor Bar have any knowledge of components rendered within one another (the attribute t:id) is not global.
> 
> Correct. A t:id is local to the template at which it's declared.
> 
>> I therefore infer that
>> component communication occurs only when they coincide within the same
>> immediate container and one component is child to the other.  Is this correct?
> 
> No. I can see these kinds of communication in Tapestry:
> 
> * Events (inner to outer)
> * Parameters (outer to inner)
> * Environment (outer to inner and inner to outer)
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> 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: Triggering zone updates external to the event trigger's container...

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, 08 May 2011 23:23:15 -0300, revprez <re...@correlatesystems.com>  
wrote:

> Say I have a component Foo that defines an action link on a zone  
> rendered by component Bar.

Components are supposed to be self-contained, so having one component  
updating a zone inside another one is not recommended at all.

> I receive an error noting that Foo does not define a component Bar.
> My understanding is that neither components Foo nor Bar have any  
> knowledge of components rendered within one another (the attribute t:id)  
> is not global.

Correct. A t:id is local to the template at which it's declared.

> I therefore infer that
> component communication occurs only when they coincide within the same
> immediate container and one component is child to the other.  Is this  
> correct?

No. I can see these kinds of communication in Tapestry:

* Events (inner to outer)
* Parameters (outer to inner)
* Environment (outer to inner and inner to outer)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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