I'm trying to set the set the value of a hidden text field (at "page/metadata/dcrType") to the dcr name using IWDCRInfo.getDCRName(). The form api code is below.
When I do a file->new form entry and save it, the save is successful and I get the expected alert box which I use for debugging in my handler. However, when I open the dcr in a text editor to check the xml, the element at "page/metadata/dcrType" is empty. But if I click Save again for the 2nd time, the value gets populated.
Why is that? I also tried onSaveNameSpecified... same thing.
function init()
{
IWDatacapture.getItem("page/metadata/dcrType").setValue("Testimonials");
IWEventRegistry.addFormHandler("onSaveDone", handleSaveDone);
}
function handleSaveDone(saveSuccessful)
{
if(saveSuccessful)
{
IWDatacapture.getItem("page/metadata/dcrName").setValue(IWDCRInfo.getDCRName());
alert(IWDatacapture.getItem("page/metadata/dcrName").getValue());
}
else
{
IWDatacapture.getItem("page/metadata/dcrName").setValue("noLink");
}
}
init();
TS 6.5
Windows 2000 Server
Edited by yanSi on 05/09/05 07:32 AM (server time).