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)
dcr-autonaming
Ottawa_IWOV
I have this feature turned on for my data-type , but I can't seem to get the name of the DCR. I need to pass it to a callServer script.
I have tried OnSaev, onSaveValid, nothing!! It seems like getDCRName() doesn't work :-(
Find more posts tagged with
Comments
Johnny
it probably doesn't come up until after onSaveDone ... have you tried that?..
might mean you need to save your dcr a second time depending on what you are doing.
John Cuiuli
cliffhanger
Is your problem not being able to get the DCR Name or not being able to autoname it? May be if you post the code, someone could help you.
-cliffhanger
Ottawa_IWOV
The problem is, I can't get the DCR name, the autonaming is fine.
Here's the code
function init() {
IWEventRegistry.addFormHandler("onSaveValid", setMetadata);
}
function setMetadata() {
alert("saving metadata");
var params = new Object();
var title = IWDatacapture.getItem("/title").getValue();
var description = IWDatacapture.getItem("/description").getValue();
var userName = IWDatacapture.getUser();
params.title = title;
params.description = description;
params.creator = userName;
params.dcrName = IWDCRInfo.getDCRName();
var server = window.location.hostname;
var url = "http://"+server+"/iw-bin/iw_cgi_wrapper.cgi/test.ipl";
//alert(url);
IWDatacapture.callServer(url,params,true);
return true;
}
init();
Edited by Ottawa_IWOV on 01/20/05 12:26 PM (server time).
volumetrie_7j_gp_mobi_ent_mvno001.zip
volumetrie_7j_gp_mobi_ent_mvno002.zip
cliffhanger
As John already pointed out, the DCR is not named on OnSaveValid. You can try the server call on OnSaveNameSpecified.
That should work fine.
Ottawa_IWOV
Nope, onSaveNameSpecified doesn't do it either ...
Johnny
Did you try my original post - onSaveDone
onSaveNameSpecified is only fired if a user manually saves the DCR.
John Cuiuli
Adam Stoller
Also - don't just call init(); - instead use:
IWEventRegistry.addFormHandler("onFormInit", init);
This has been posted about several times - as the solution for getting around timing problems with regard to the rendering of the DCT.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cliffhanger
I was just reading the OnSaveNameSpecified documentation, and I am not sure when it would get triggered if at all, for autonaming.
However, you can use OnSaveDone, by the time onSaveDone gets triggered, the DCR is already named.
-cliffhanger
Ottawa_IWOV
onSaveDone is doing the trick. Sorry for the boneheadedness on this one! Thanks a bunch for the quick replies!!