RE: Getting Block content as String

2013-10-10 Thread Lance Java
> because if at that point I inspect the block instance (Eclipse debug) I see the instance already contains that text. I've never really looked into the inner workings of a block. The only thing you should ever need to know about a block is that it can be coerced to a RenderCommand. I'm sure it ho

RE: Getting Block content as String

2013-10-10 Thread Davide Vecchi
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 subse

Re: Getting Block content as String

2013-10-09 Thread Thiago H de Paula Figueiredo
On Wed, 09 Oct 2013 11:21:57 -0300, Davide Vecchi 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 i

RE: Getting Block content as String

2013-10-09 Thread Lance Java
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?

RE: Getting Block content as String

2013-10-09 Thread Lance Java
You can only get the rendered HTML after the point at which your block is rendered to tapestry's MarkupWriter. So, you only have an opportunity to get the HTML in a full page render request or an AJAX event request which causes a partial page render Getting the HTML in a non-ajax action (ie your

RE: Getting Block content as String

2013-10-09 Thread Davide Vecchi
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 p

Re: Getting Block content as String

2013-10-09 Thread Thiago H de Paula Figueiredo
On Wed, 09 Oct 2013 04:10:55 -0300, Davide Vecchi wrote: Hi, thanks for the assistance. The template is quite big so I will have to strip it down much, to avoid posting a lot of unrelated stuff; I will do that as soon as possible. Hi! Ok! I guess just the part containing the "label" field

Re: Getting Block content as String

2013-10-09 Thread Lance Java
It's probably overkill but depending on what you are doing, you might find tapestry-offline useful https://github.com/uklance/tapestry-offline

Re: Getting Block content as String

2013-10-09 Thread Lance Java
Here's some discussion which has a couple of answers http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Encoding-a-template-as-a-valid-JSON-String-td5723504.html

RE: Getting Block content as String

2013-10-09 Thread Davide Vecchi
k instance ? I believe so but I'm not sure. -Original Message- From: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: Tuesday, October 8, 2013 19:20 To: Tapestry users Subject: Re: Getting Block content as String Hi! Please post the block template and the code it uses

Re: Getting Block content as String

2013-10-08 Thread Thiago H de Paula Figueiredo
Hi! Please post the block template and the code it uses so we can have a better picture. On Tue, 08 Oct 2013 11:07:30 -0300, Davide Vecchi wrote: I have an instance of org.apache.tapestry5.Block and I would like to get this block's content as a String. When I inspect that Block instance

Getting Block content as String

2013-10-08 Thread Davide Vecchi
I have an instance of org.apache.tapestry5.Block and I would like to get this block's content as a String. When I inspect that Block instance, I see the block content that I need to get: there is a field called "elements" which is an ArrayList with 3 elements. One of them is an ExpansionPageEle