You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sascha Tandel <s....@kenoxa.de> on 2009/09/28 16:19:52 UTC

[T5] modify markup with PartialMarkupRendererFilter

Hi,

i try to modify the generated markup of a ajax request. My  
PartialMarkupRendererFilter modifies the markup through the  
MarkupWriter:

public void renderMarkup(MarkupWriter writer, JSONObject reply,  
PartialMarkupRenderer renderer) {
		renderer.renderMarkup(writer, reply);

		addMarkup(writer)
}

The writer contains the added elements but in reply.content is still  
the old markup.

When i add

		final String content = root.getChildMarkup().trim();
		reply.put("content", content);

it works.

Put it doesn't "feel" right. I think it has something to do with the  
order of the PartialMarkupRendererFilters.

Here is my contribution method:

public void contributePartialMarkupRenderer 
(OrderedConfiguration<PartialMarkupRendererFilter> configuration) {
		configuration.addInstance("MyFilter", MyFilter.class,  
"after:Heartbeat");
}


Can somebody give me a hint how to solve that problem.

Thanks
Sascha




Re: [T5] modify markup with PartialMarkupRendererFilter

Posted by cordenier christophe <ch...@gmail.com>.
What kind of modifications are you doing on the generated Markup ? Listening
to the end of the root element should be enough to treat the whole document.
But I may have missed something.

2009/9/28 Tandel Sascha <sa...@tandel-online.com>

>
> Am 28.09.2009 um 17:12 schrieb cordenier christophe:
>
>  Hi
>>
>> Have you test with a MarkupWriterListener ?
>>
> I didn't know that interface.
>
>  But that will not work because i need the whole generated content.
>
>
>> 2009/9/28 Sascha Tandel <s....@kenoxa.de>
>>
>>  Hi,
>>>
>>> i try to modify the generated markup of a ajax request. My
>>> PartialMarkupRendererFilter modifies the markup through the MarkupWriter:
>>>
>>> public void renderMarkup(MarkupWriter writer, JSONObject reply,
>>> PartialMarkupRenderer renderer) {
>>>              renderer.renderMarkup(writer, reply);
>>>
>>>              addMarkup(writer)
>>> }
>>>
>>> The writer contains the added elements but in reply.content is still the
>>> old markup.
>>>
>>> When i add
>>>
>>>              final String content = root.getChildMarkup().trim();
>>>              reply.put("content", content);
>>>
>>> it works.
>>>
>>> Put it doesn't "feel" right. I think it has something to do with the
>>> order
>>> of the PartialMarkupRendererFilters.
>>>
>>> Here is my contribution method:
>>>
>>> public void
>>>
>>> contributePartialMarkupRenderer(OrderedConfiguration<PartialMarkupRendererFilter>
>>> configuration) {
>>>              configuration.addInstance("MyFilter", MyFilter.class,
>>> "after:Heartbeat");
>>> }
>>>
>>>
>>> Can somebody give me a hint how to solve that problem.
>>>
>>> Thanks
>>> Sascha
>>>
>>>
>>>
>>>
>>>
>

Re: [T5] modify markup with PartialMarkupRendererFilter

Posted by Tandel Sascha <sa...@tandel-online.com>.
Am 28.09.2009 um 17:12 schrieb cordenier christophe:

> Hi
>
> Have you test with a MarkupWriterListener ?
I didn't know that interface.

  But that will not work because i need the whole generated content.

>
> 2009/9/28 Sascha Tandel <s....@kenoxa.de>
>
>> Hi,
>>
>> i try to modify the generated markup of a ajax request. My
>> PartialMarkupRendererFilter modifies the markup through the  
>> MarkupWriter:
>>
>> public void renderMarkup(MarkupWriter writer, JSONObject reply,
>> PartialMarkupRenderer renderer) {
>>               renderer.renderMarkup(writer, reply);
>>
>>               addMarkup(writer)
>> }
>>
>> The writer contains the added elements but in reply.content is  
>> still the
>> old markup.
>>
>> When i add
>>
>>               final String content = root.getChildMarkup().trim();
>>               reply.put("content", content);
>>
>> it works.
>>
>> Put it doesn't "feel" right. I think it has something to do with  
>> the order
>> of the PartialMarkupRendererFilters.
>>
>> Here is my contribution method:
>>
>> public void
>> contributePartialMarkupRenderer 
>> (OrderedConfiguration<PartialMarkupRendererFilter>
>> configuration) {
>>               configuration.addInstance("MyFilter", MyFilter.class,
>> "after:Heartbeat");
>> }
>>
>>
>> Can somebody give me a hint how to solve that problem.
>>
>> Thanks
>> Sascha
>>
>>
>>
>>


Re: [T5] modify markup with PartialMarkupRendererFilter

Posted by cordenier christophe <ch...@gmail.com>.
Hi

Have you test with a MarkupWriterListener ?

2009/9/28 Sascha Tandel <s....@kenoxa.de>

> Hi,
>
> i try to modify the generated markup of a ajax request. My
> PartialMarkupRendererFilter modifies the markup through the MarkupWriter:
>
> public void renderMarkup(MarkupWriter writer, JSONObject reply,
> PartialMarkupRenderer renderer) {
>                renderer.renderMarkup(writer, reply);
>
>                addMarkup(writer)
> }
>
> The writer contains the added elements but in reply.content is still the
> old markup.
>
> When i add
>
>                final String content = root.getChildMarkup().trim();
>                reply.put("content", content);
>
> it works.
>
> Put it doesn't "feel" right. I think it has something to do with the order
> of the PartialMarkupRendererFilters.
>
> Here is my contribution method:
>
> public void
> contributePartialMarkupRenderer(OrderedConfiguration<PartialMarkupRendererFilter>
> configuration) {
>                configuration.addInstance("MyFilter", MyFilter.class,
> "after:Heartbeat");
> }
>
>
> Can somebody give me a hint how to solve that problem.
>
> Thanks
> Sascha
>
>
>
>