Hi!

Have you checked its source? Here's the 5.1.0.5 one (which is the version used in the project I'm working now):

public class MultiZoneUpdateEventResultProcessor implements ComponentEventResultProcessor<MultiZoneUpdate>
{
    private final PageRenderQueue queue;

    private final TypeCoercer typeCoercer;

public MultiZoneUpdateEventResultProcessor(PageRenderQueue queue, TypeCoercer typeCoercer)
    {
        this.queue = queue;
        this.typeCoercer = typeCoercer;
    }

public void processResultValue(final MultiZoneUpdate value) throws IOException
    {
// There has to be at least a single command in the queue to force a render.
        queue.initializeForPartialPageRender(new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
            }
        });

        queue.addPartialMarkupRendererFilter(new SetupZonesFilter());

        Map<String, Object> map = value.getZoneToRenderMap();

        for (String zoneId : map.keySet())
        {
            Object provided = map.get(zoneId);

            RenderCommand zoneRenderCommand = toRenderer(zoneId, provided);

queue.addPartialMarkupRendererFilter(new SingleZonePartialRendererFilter(zoneId, zoneRenderCommand, queue));
        }
    }

    private RenderCommand toRenderer(String zoneId, Object provided)
    {
        try
        {
            return typeCoercer.coerce(provided, RenderCommand.class);
        }
        catch (Exception ex)
        {
throw new IllegalArgumentException(String.format("Failure converting renderer for zone '%s': %s",
                                                             zoneId,
InternalUtils.toMessage(ex)), ex);
        }
    }
}

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to