Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
onReplicantDelete(d) Event Handler
djhalliday
TeamSite 6.5 SP1
Windows Server 2003 Enterprise Edition
Hi -
Is there an event handler in formAPI that can deal with a form
after
a replicant is deleted? Documentation only provides information for 'onReplicantDelete', which is triggered before the replicant instance is actually deleted.
If anyone knows any workarounds to this, I'd appreciate any help. To give some context to this question, I'm calling a function on this event that updates a field within each of the replicants of a container called 'sort order'. This update keys off of the index of the replicants in the array, so it's not much good to reorder if the replicant hasn't been deleted yet.
Thanks in advance,
Derek
===================================================================================================
Event Registry Entry:
IWEventRegistry.addItemHandler("/collection/replicantA"
, "OnReplicantDelete"
, reOrder);
reOrder Function:
function reOrder(item) {
// match for end [#] indicating index
if (item.getName().match(/\[.*\]$/)) {
var parent = IWDatacapture.getItem(item.getName().split("[")[0]);
}
else {
var parent = item;
}
var children = parent.getChildren();
for (var i = 0; i < children.length; i++) {
IWDatacapture.getItem(children
.getName() + "/sort_order").
setValue((i+1).toString());
}
return true;
}
Find more posts tagged with
Comments
There are no comments yet