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)
getItem() is returning null
SriniYA
I would like to validate the DCR. I have the following code in the datacapture.cfg file. titleItemName alert is returning null.
Can someone suggest what I need to do to fix this
Thanks in advance.
Sri
IWEventRegistry.addItemHandler("/Section/Container/Selected", "onItemChange", doValidateForm );
IWEventRegistry.addFormHandler("onSave", saveHandler);
//*********************************************************************************************
// saveHandler
//*********************************************************************************************
function saveHandler(button) {
var button_fun_status;
switch (button) {
case IWDatacapture.SAVE_BUTTON:
{
//alert("User clicked on save button");
button_fun_status = doValidateUserInput();
break;
}
case IWDatacapture.SAVECLOSE_BUTTON:
{
//alert("User clicked on saveClose button");
button_fun_status = doValidateUserInput();
break;
}
}
if (button_fun_status) {
alert ("returning true");
return true;
} else {
alert ("returning false");
return false;
}
}
//*********************************************************************************************
// doValidate User input
//*********************************************************************************************
function doValidateUserInput() {
titleItemName = IWDatacapture.getItem("/Section/Container/Selected/Title");
alert ("titleItemName" + titleItemName);
titleItemValue = titleItemName.getValue();
alert ("titleItemValue: " + titleItemValue);
}
Find more posts tagged with
Comments
Migrateduser
Can you attach/post (without markup/html) the DCT?
SriniYA
I have attached the file
Thanks
Sri
Michael
Could you attach the DCT as well? Maybe your path/item name is incorrect but it is impossible to say without the DCT...
Cheers
Michael
AKB
IWEventRegistry.addItemHandler("/Section/Container/Selected", "onItemChange", doValidateForm );
titleItemName = IWDatacapture.getItem("/Section/Container/Selected/Title");
If we see the above two lines what is the name of the field ? selected or title ?