Hello,
I know this is covered before and probably should 'just work'. I'm trying to manipulate some paths (removing a WebContent root directory) by using addItemHandler. It works for items not within a replicant, but not for items within replicants.
Can anyone see what I'm missing? I'm using TeamSite 6.7.0 on Windows 2003.
Thanks!
Here's my script code:
var root = "/WebContent";
IWEventRegistry.addItemHandler("/internet_page_dcr/shortcolimg", "onItemChange", fixPath);
IWEventRegistry.addItemHandler("/internet_page_dcr/col_A/content/links/iurl_type/iurl", "onItemChange", fixPath);
IWEventRegistry.addItemHandler("/internet_page_dcr/col_B/content/links/iurl_type/iurl", "onItemChange", fixPath);
IWEventRegistry.addItemHandler("/internet_page_dcr/col_C/content/links/iurl_type/iurl", "onItemChange", fixPath);
function fixPath(item) {
if(item.getValue().substring(0, root.length) == root) {
item.setValue(item.getValue().substring(root.length));
IWDatacapture.redraw();
}
}
And here are the containers and the items in question (for brevity, other items have been removed):
[html]
<span style="width: 310px;">Specify an optional image to display on the right side of the shortcolumn template. Upload your images to<br /> '/<code style="color:#b11a3b">[yourProject]</code>/html/en/site/assets/images' to display here.</span>
<span style="width: 190px;">Main content area for the Web page.<br /><br />Dividing content between Column A and Column B is recommended.</span><br /><br />Required
<span style="width: 190px;">Preferred method of adding links to a Web page.</span>
<span style="width: 190px;">Use to link to an HTML page within the current site.</span>
<span style="width: 190px;">Browse to a generated HTML page, or enter a path that begins with <strong>/</strong> (the root directory of current site). <br /><br /> <strong>Link to an HTML file only.</strong></span><br />
[/html]