var: is for simple usages only,
var: is not a prefix like prop: it will not generate an expression

extracting type from combined binding is i a tedious job and probably
not even possible do be done right:

 <div t:type="loop" source="recentPosts" value="var:post">

tapestry would have to know somehow about the connection between
recentPosts and var:post

loop is just a component... how is T5 supposed to know that elements from
recentPosts are to be stored into var:post....



use page properties, this way tapestry can compile expressions in advance...

private Post post;

..getPost()
..setPost()

if you don't want getters and setters "cluttering" your code , someone
on the list
has a solution that can add them on the fly via annotation....


hope I'm making sense...

Davor Hrg

On Jan 7, 2008 8:07 PM, Chris Lewis <[EMAIL PROTECTED]> wrote:
> I like the new var: prefix for temp variables, although I can't find any
> docs on how to properly use it. Here's my template code:
>
> <div t:type="layouts/General" title="e"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>     <div t:type="loop" source="recentPosts" value="var:post">
>         <div>${var:post}</div>
>         <div>${var:post.title}</div>
>         <div>${var:post.body}</div>
>         <div>${var:post.created}</div>
>     </div>
> </div>
>
>
> When I run this I get an exception:
>
> "Component blog/Start does not contain a stored render variable with
> name 'post.title'. Stored render variables: post."
>
> So it sees my stored render variable, but thinks post.something
> represents a different property. Having just read the issue at
> https://issues.apache.org/jira/browse/TAPESTRY-1830 it seems that only
> simple objects (probably ending in a toString call?) are supported. Is
> that true, and if so, is that the extent of what will be done? I haven't
> dug in to the code, but couldn't you infer the type based on the type of
> the collection supplied to the source parameter?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to