On Wed, 09 Oct 2013 11:21:57 -0300, Davide Vecchi <d...@amc.dk> wrote:
Thiago: thanks for the clarification. I actually went for some redesign;
I gave up trying to get the block content, although it still feels a bit
weird to me, probably just because I'm new to Tapestry.
Where the data is coming from is just a block that I had put in the
template with the exact purpose of holding some text that the Java code
might need under some circumstances. Now I realized this is not what
blocks are intended for, so I'm going another route.
You were probably confusing the use of blocks with the one of components.
However I had already prepared a trivial example of the problem of
getting the block content, so although I no longer need to solve that
I'm posting the example anyway because it would still be interesting to
see if there was a way.
There's not a way because in Tapestry it makes no sense for doing that.
Blocks are pieces of template.
Lance: thanks for the tips; I believe in the thread you linked I was
supposed to look at post "Sep 19, 2013; 12:13pm", which actually does
what I was asking for, get the block content as String. However in my
specific case I wouldn't have been able to use it because if I
understood correctly that requires having in Java a Block field
(myBlock) named like the block in the template, while in my case the
block name is generated at runtime and it might or might not match an
existing block.
Block names (id) are static, so they cannot be generated at runtime. You
can use them dynamically, but their declaration is completely static.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org