You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa Gomez" <dc...@fixed.com> on 2003/05/12 00:07:50 UTC

Verification of understanding binding & inherited-binding

Hi all,

I would just like to make sure that my understanding of inherited-binding 
(opposed to binding) is correct.

Ordinary binding takes place in case one does something between the 
component.jwc(/container) and its corresponding java class.
Example:
	<component id="tableView" type="contrib:TableView">
		<binding name="tableModel" expression="tableModel"/>
		<binding name="tableSessionStateManager" 
expression="tableSessionStateManager"/>
	</component>
...
The java class is expected to have get/set methods for tableModel as well 
as tableSessionStateManager.


OTOH inherited-binding is used for "linking" parameter(s) of the 
component.jwc(/container) to (un)required parameters of *contained (/used)* 
components.
Example:
<component-specification class="org.dcg.tests.ArrayViewer" allow-body="no" 
allow-informal-parameters="yes">
	<parameter
		name="componentSource"
		java-type="java.lang.Object"
		direction="in"
		required="yes">
	</parameter>

	<component id="elements" type="Foreach">
		<inherited-binding name="source" parameter-name="componentSource"/>
	</component>
...
By using the ArrayViewer in a .page component spec the componentSource gets 
"filled" and finds it way to the Foreach via the inherited binding.

Now that I'm on the subject of binding there is one other thing that made 
me raise an eyebrow.