Hello,
Summary: what I would like to do is to insert an item in a replicant Y when an item is added in a replicant X
I am working on a multiple pages DCT basically there is 1 page per language (there is a top level container for each language and item-per-page="1" in the templating.cfg).
Each top level container contains exactly the same structure (even the name of the items/containers are the same).
For data consistancy, I want to make sure there is the same number of "replicants" on each page, the problem is that I need a piece of code that is generic enough so it can be resused in all the DCT with a small effort.
I thought it was possible to put an event on an item itsef like in HTML so it could pass itself as argument and I could reuse the same function everywhere (changing the language in the XPath since the structure is the same in all the top-level containers) but it seems it is not possible.
I wanted to do something like - dummy example - <item name="title" onchange="updateReplicants(this)">
But all I found is :
IWEventRegistry.addItemHandler();
This is really annoying since I have to set an event handler for each element within a replicant and if there is a replicant into a replicant it becomes ****.
passing "this" would have been so simple

((
I'm using TS6.1 with SP2.
All ideas are welcome !!!!!
For info here is a very simple piece of code of a DCT so you can imagine better the structure :
...
<container name="english" location="english">
<container name="paragraph" location="paragraph" min="1" max="10">
<item name="title" pathid="title">
<text maxlength="0" required="t" size="40" />
</item>
<item name="body" pathid="body">
<textarea required="f" cols="50" rows="5"/>
</item>
</container>
</container>
<container name="french" location="french">
<container name="paragraph" location="paragraph" min="1" max="10">
<item name="title" pathid="title">
<text maxlength="0" required="t" size="40" />
</item>
<item name="body" pathid="body">
<textarea required="f" cols="50" rows="5"/>
</item>
</container>
...
Edited by pierreyves on 03/29/05 06:59 AM (server time).