Hi All,
Im having some issues with addressing an item within a nested replicant and registering an onChangeEvent for it. The item Im trying to target is located in the DCR tree at
/page/body/section/contentGroup/contentItem/buttonHere is the DCR:
<page language="en_US" outpath="careers/index.jhtml" region="north_america">
<body>
<section rowcontinue="f">
<contentGroup rowcontinue="f">
<contentItem>
.....
</contentItem>
<contentItem>
.....
</contentItem>
<head/>
</contentGroup>
<contentGroup rowcontinue="t">
<contentItem>
....
</contentItem>
<contentItem>
<button link="register.html" type="small">Register</button> </contentItem>
<head>New Users</head>
</contentGroup>
<head>Worldwide Career Opportunities</head>
</section>
<head/>
</body>
</page>
In the DCT itself, Id like to call a function if the user edits ANY button item. This is my attempt which so far does not work:
//enable button generation workflow if the user has added or changed a button
IWEventRegistry.addItemHandler("/page/body/section/contentGroup/contentItem/button", "onItemChange", enableButtonWorkFlow);
The button container in the DCT looks like this:
<container name="button" location="button" min="1" max="unbounded" default="1">
<label>Button</label>
<item name="btn" pathid="#PCDATA" rowcontinue="t">
<label>Button</label>
<description>Enter text to appear on graphical button.</description>
<text required="t" size="32"/>
</item>
<item name="type" pathid="
@type" rowcontinue="f">
<label>Button Size</label>
<radio>
<option value="small" label="Small" selected="t"/>
<option value="large" label="Large"/>
</radio>
</item>
<item name="link" pathid="
@link" rowcontinue="f">
<label>Button Link</label>
<description>The hyperlink of this button.</description>
<browser required="t" initial-dir="/Plantronics/doc" size="54"/>
</item>
</container>
Ive tried addressing the "btn" item directly within the button container by appending "btn" to the path, but this returns null. I have been trying to debug by alerting the value of the button element, but this always returns null. I can get it to return an "andreplicantcontainer" object if I indicate the index of the exact item like this:
/page/body/section[1]/contentGroup[2]/contentItem[2]/button
But Id like to register the onChange event any time the user edits ANY item in the button container, independent of its index in the tree. Where am I going wrong?