Hi Rama,U can achieve this using some formApi coding..lets say your button item is "/ContainerName[replicantNum]/button"Call a funtion on click of ur button:function funcName(item){ var itemName = item.getName(); var startPos = itemName.indexOf("["); var endPos = itemName.indexOf("]"); startPos += 1; var index = itemName.substring(startPos,endPos);}This index gives the replicant number.
A bit cleaner and more flexible IMO (easier to adjust for nested Replicants, etc...)function funcName(item) { item.getName().match(/\[(\d+)\]/); var ordinal = RegExp.$1;}
or this [HTML]var itemIndex = itemName.replace(/.*\[([0-9]+)\]/, "$1");[/HTML]
Remember, Event Handler gets an Item Object as a parameter. So, in your syntax you'd have to obtain a Name first, eg:
i assumed that: 1) itemName would mean get Name of the item [...] 2) the word item alone would be the item objecti am surprised you didn't get it
var itemIndex = itemName.replace(/.*\[([0-9]+)\]/, "$1");
AJust for the thread completness, does this line contain other "assumptions" as well?