Thanks for all the info, good learning tool for me.

> Getting the HTML in a non-ajax action (ie your action) is not (easily)
> possible since tapestry doesn't render anything to the MarkupWriter in the
> action request. Instead, tapestry returns a 304 redirect and the render
> happens in the subsequent request.

Got it. The reason why I thought it was possible is that it looks to me that my 
content is already rendered at the point where I was hoping to get it, because 
if at that point I inspect the block instance (Eclipse debug) I see the 
instance already contains that text. I'm attaching a screenshot of the Inspect 
window.

> As Thiago said, can you specify the value somewhere (message catalogue, 
> database etc)
> and reference the same value in both the template and the action?

My specific case is a bit complicated, however I noted your suggestion as one 
of the right ways to do that and in the future I will certainly benefit from 
it, thanks.

> There's not a way because in Tapestry it makes no sense for doing that.
> Blocks are pieces of template.

Actually the fact that blocks are pieces of template is probably where my 
misunderstanding started. I thought it was possible to put some text in a 
template block so that I could just retrieve it from Java. Now I realized 
that's not what blocks are for.

> Block names (id) are static, so they cannot be generated at runtime. You
> can use them dynamically, but their declaration is completely static.

I think I explained myself badly. I meant that in Java I compose the block name 
at runtime, so I can't have a Block field named like the template block id. In 
my example above it would be like if instead of

        Block block = this.componentResources.getBlock("myBlock"); 

there was

        String var1 = "my";
        String var2 = "Block";
        Block block = this.componentResources.getBlock(var1 + var2);

except of course that the 2 strings are not hardcoded like that, they come from 
somewhere.

This whole problem started just because I didn't go the Tapestry way since the 
beginning, so now that I realized that everything is sweet :)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to