Hi Dmitriy,
I solved similar problem by chaining list of MultiZoneUpdate, each with its
own RenderCommand, something like that:

@Inject
private Block myBlock;
....

MultiZoneUpdate mzu = null;
for(String id : indexes) {
    mzu = addMZU(mzu, "zone-" + id, prepareRender(id));
}

....
    private RenderCommand prepareRendering(final String id) {
        return new RenderCommand() {
            @Override
            public void render(MarkupWriter writer, RenderQueue queue) {
                ((RenderCommand)myBlock).render(writer, queue);
                queue.push(new RenderCommand() {
                    @Override
                    public void render(MarkupWriter writer, RenderQueue
queue) {
                        currentId = id;
                    }
                });
            }
        };
    }

in .tml, I have:
<t:block t:id="myBlock">
   Here rendering based on ${currentId}
</t:block>

<t:loop value="currentId" ....>
   <t:zone id="zoneId"><t:delegate to="block:myBlock"/></t:zone>
</t:loop>

I can not guarantee that it is the simplest way, but it works for me.

Regards,
Cezary

On Tue, Feb 22, 2011 at 4:16 PM, Dmitriy Vsekhvalnov <dvsekhval...@gmail.com
> wrote:

> Hi all,
>
>  i'm looking for some ideas how to update entire column in html table,
> without updating overall table.
>
> For instance:
> <table>
> <tr t:type="loop" source="rows" value="rowValue" index="rowIndex">
>                        <td>${rowValue.a}</td>
>                        <td>${rowValue.b}</td>
>                        <td>${rowValue.c}</td>
>                        <td>
>                            <t:zone t:id="myZone" id="myZone-${rowIndex}">
>                                    ${some rowValue derived text or other
> components}
>                            </t:zone>
>                        </td>
> </tr>
> </table>
>
> on some event i want to update all zones with t:id="myZone".   The issue is
> that with XHR request t:loop is not executed and rowValue property is not
> bound.
>
> So even if i return properly populated MultiZoneUpdate it is rendered
> incorrectly, because rowValue is not changed before invocations.
>
> Any ideas how i can force t:loop to be executed or force myZone body to be
> rendered (i can re-iterate collection myself in handler method)?
>
> Thanks.
>

Reply via email to