Hi !

You could try with ...

<t:loop>
<t:calendar.timeSlot t:id="myTimeSlot" />
</t:loop>

( TimeSlot.tml )

<p id="${myClientId}" />

...this clientId property is generated in the Java.Side with the following
method ( at SetupRender )

( TimeSlot.java  )

    @Property
     private String myClientId;

    @Inject
    private ComponentResources componentResources;

    @Inject
    private RenderSupport renderSupport;

    @SetupRender
    void setupRender() {
        myClientId = renderSupport.allocateClientId(componentResources);
    }

... and you will have a sequence of DOM IDs generated : "myTimeSlot_1", "myTimeSlot_2", ....

That´s all ,

Best Regards,

--
Antonio Miguel Fernández Rodríguez
Jaraxa Software, SL
Administrator, Software analyst
Cel. +34 607 78 86 85
www.jaraxa.com



El 03/12/2010 12:52, Joost Schouten (ml) escribió:
It sounds like you are confusing the t:id with the html dom id. I think you are looking for:

<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
<t:loop source="startCals" value="currentStartCal">
<p t:id="yourComponentId" id="${index}" t:type="calendar/timeSlot"/>
</t:loop>
</t:container>

Cheers,
Joost



On 3/12/10 12:54 PM, Christian Koller wrote:
I have the following template:

<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
<t:loop source="startCals" value="currentStartCal">
<p t:id="prop:index" t:type="calendar/timeSlot"/>
</t:loop>
</t:container>

But Tapestry calls out:
Component id 'prop:index' is not valid; component ids must be valid Java identifiers: start with a letter, and consist of letters, numbers and underscores.

Is it not possible to use a property as id?

If I use a literal as the id, then it works, but then all the generated timeSlot components within the loop will have the same id. If I use afterwards the persist annotation within the timeSlot component all the generated timeSlots share this session value because the id is the same.

Any ideas how to solve this?
Thank you
chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



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


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

Reply via email to