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)
Container Name
acezone
Hi All,
It would be great if you someone may provide their inputs in order to fetch the container name using FormAPI where container combination is set as "OR". Below is the JS Code applied:
IWEventRegistry.addFormHandler("onFormInit", init);
function handleNamePage() {
var folderItem = IWDatacapture.getItem("/Detail/PageType");
var folderName = folderItem.getOptions()[folderItem.getValue()].value;
var item = IWDatacapture.getItem("/Detail/DetailPage");
var itemObj = item.getChildren();
if(IWDCRInfo.getDCRName() == "") {
alert ("This is my selected container "+ itemObj);
IWDCRInfo.setDCRName("news_"+folderName+"_"+itemObj+"_details");
}
return true;
}
function init() {
IWEventRegistry.addFormHandler("onSave", handleNamePage);
}
Below is the alert I see:
This is my selected container [IWItem andcontainer /Detail/DetailPage/BeginnerCourses]
and Save was unsuccessful.
Whereas, my requirement is to have "BeginnerCourses" as fetch output.
Regards,
Ace
Find more posts tagged with
Comments
curiousmaverick
IWItem.getName()
gives you the
XPath-like
address for the particular item. You may then apply some standard
JS operation/function
on this to come out with your desired string.