TeamSite 6.1 SP1 / Solaris 8
How can I determine when the Preview button triggers the save process?
According to the FormAPI manual on page 22 this can be accomplished simply by :
In reply to:
The onSave event handler is passed an integer that indicates what button triggered the
event. In this way, the save handler can determine how the save was triggered and behave
differently if necessary:
function saveHandler(button) {
switch (button) {
case IWDatacapture.SAVE_BUTTON:
case IWDatacapture.SAVEAS_BUTTON:
case IWDatacapture.SAVECLOSE_BUTTON:
// User clicked 'Save', 'Save As' or 'Save and Close'
...
break;
case IWDatacapture.PREVIEW_BUTTON:
case IWDatacapture.GENERATE_BUTTON:
// User clicked 'Preview' or 'Generate'
...
break;
}
}
The problem is that when the Preview button triggers the save event the integer passed to the handle is 1 not 4? Seems like a BUG? Does anyone have a workaround?
Relevant Code :
IWEventRegistry.addFormHandler("onSave", buttonHandler);
function buttonHandler(button) {
alert(button); // always alerts 1
}