in tapestry we can use the component in two ways
<t:type="grid" t:source="persons" t:row="person" t:encoder="personEncoder" t:include="id,firstname,lastname,startdate" t:add="delete"\>
or we can use
<t:grid source="persons" row="person" encoder="personEncoder" include="id,firstname,lastname,startdate" add="delete"></t:grid>
So my question is that is there any difference or specific reason to use the components in two different way?
Regards,
Mahendra Athneria
Does the first one really work? I think you mean
vs.
If so, there is no functional difference. I always prefer using the first style because it looks like proper HTML with instrumentation instructions for Tapestry, rather than just a bunch of Tapestry-specific tags.
The
t:prefix for component parameters refers to the Tapestry namespace and is the clean way to define value bindings. Both styles will work with eithert:present or omitted, as it is optional in most places, except in the odd case when it is not. (For example, you’ll sometimes want bothidandt:idonZonecomponents, and they’ll actually mean different things.)TL;DR: Use the
<table t:type="grid" t:source="" ... />style.