Hi,
I have a req to generate a html on clicking Finish.Which i renamed Finish to save and generate.So,If the user clicks Finish(save and generate) button,I have some validations in onsave and onsavevalid and in the onsavedone I am writing a generate html function.But sometimes the generation is skipped..So for giving the event time..I kept an alert in onsavedone saying saving is complete.Now the callserver generate.ipl is called and also i am sending the response back to javascriptt.If there is an error giving them alert saying that generation is failed contact your admin or something like that.But the callback js function is not executed..Can someone please help in this regard
function generate()
{
alert("Saving is complete");
dcrName = IWDCRInfo.getDCRName();
var params;
if(dcrName!="")
{
var presentationTemplate = IWPageGeneration.getPresentationTemplate();
var extn = presentationTemplate.getExtension();
var outputFile = "/"+ "html" +"/"+"test" + "." + extn;
IWPageGeneration.setPresentationTemplate (presentationTemplate);
IWPageGeneration.setOutputFile(outputFile);
currDCTPath = IWDatacapture.getDCTPath();
n = currDCTPath.indexOf(DEFAULT_BRANCH);
s = currDCTPath.lastIndexOf("/");
currDCTPath = currDCTPath.slice(n,s);
workarea=IWDatacapture.getWorkarea();
workarea=workarea.slice(n,s);
currDCRPath = currDCTPath + DCR_PATH;
currTPLPath = currDCTPath + TPL_PATH;
templatepath = currTPLPath + "/" + TPL_NAME;
recordvpath = currDCRPath + "/" + dcrName;
var params = new Object();
params.workarea = workarea;
params.templatepath = templatepath;
params.recordvpath = recordvpath;
params.outputfile = outputFile;
IWDatacapture.callServer("http://"+server+"/iw-bin/iw_cgi_wrapper.cgi/aa_generate_page.ipl", params);
return;
}
}
/* ***************************************************************************** */
/* Function that returns the success/failure of the callServer command */
***************************************************************************** */
function getStatus(Success) {
alert("entered");
alert(Success);
if (Success == "") {
alert("Your file is saved and generated. Click Cancel to close this window");
}
else {
alert(Success);
}
return false;
}
the ipl is executed but generate status is not called..
[php]
my ${js} .= 'parent.getScriptFrame().getStatus("' . ${Success} . '" );' . "\n";
print CGI::header(), CGI::start_html( -script => ${js} ), CGI::end_html();
[/php]