You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Katherine Luxton <ka...@gamesys.co.uk> on 2011/09/15 14:19:36 UTC

Any Element Name for Embedded Components?

Hi

I have a tapestry page which contains a custom component; and I always thought that the element name given to for the component within the TML file was used to work out which component to render.  However, in my example below, it seems that I can give this component any element name I like and it will still discover what the correct Component to render is.  I'm assuming this might be because the embedded component has a t:id attribute which is declared in the java class as a specific type of component.

Is this expected behaviour in Tapesetry?  Is it right that I can use element name I like so long as I have a t:id attribute?

Cheers
Katherine


MyPage.java

...
import mypackage.components.DateOfBirth;
...
@Component
private DateOfBirth dob;
…


MyPage.tml

…
<t:dateofbirth t:id="dob" t:label="message:dob-label" t:value="member.securityQuestion.dob" t:bubbleOffsetX="104" t:optionalMessage="${message:over18-dob-message}"/>
…


But if I use this instead; the component is still found and rendered:
…
<t:wibblewobble t:id="dob" t:label="message:dob-label" t:value="member.securityQuestion.dob" t:bubbleOffsetX="104" t:optionalMessage="${message:over18-dob-message}"/>
…