Hi all,

Let’s say I have loop around a zone, and on a particular event I want to render 
just the 2nd and 4th instances of the zone. How do I do that?

        <t:loop source="1..10" value="zoneIndex">
                        
                <t:zone t:id=“thingZone" id="prop:zoneId” >
                        <!— Contents from thing goes here. —>
                </t:zone>
                                
        </t:loop>

        @Property
        private int zoneIndex;

        @InjectComponent
        private Zone thingZone;

        public String getZoneId() {
                return “thingZone_" + zoneIndex;
        }

My problem is that the following does not correctly render thing 2 and 4.

        public String onMyEvent() {

                thing = getThing(2);
                zoneIndex = 2;
                ajaxResponseRenderer.addRender(thingZone);

                thing = getThing(4);
                zoneIndex = 4;
                ajaxResponseRenderer.addRender(thingZone);

                thing = null;

        }

As you can see below, the response includes the right zone names, but the 
rendered content of them is the same and is based on whatever the final values 
were. In this case the final value of thing was null, so white space was 
rendered into both zones.

{
  "_tapestry" : {
    "content" : [
      [
        “thingZone_4",
        "\n\t\t\t\t\t\t\t\t\n\t\t\t\t"
      ],
      [
        “thingZone_2",
        "\n\t\t\t\t\t\t\t\t\n\t\t\t\t"
      ]
    ],
    "inits" : [

So addRender(ClientBodyElementZone zone) queues up the request for later. Can I 
somehow queue up each request with the current values that I want it to use 
when rendering?

Cheers,

Geoff

Reply via email to