Explain type: "ok" in code
Hi,
I have 2 questions:
1) I do not understand how something which looks like a button (see Image from Action Wizard form) shows up as a type: "ok" as shown below. I need to understand what a type of "ok" even means and why it is not a "button" as it is with the Skip and Cancel buttons. I looked and cannot find an explanation anywhere, only check boxes, buttons, etc.
2) Once I understand #1, how can I make it so that the user only has to click this "Apply Label" button once to execute the entire loop. Right now the user has to click on "Apply label" for every document open. I copied what I think are relevant parts from the code (see Excerpts of Code below).
Image from Action Wizard Form:

Excerpts of Code (with relevant text in red):
{
type: "view",
align_children: "align_top",
alignment: "align_top",
elements:
[
{
type: "ok",
ok_name: "Apply Label",
},
{
type: "button",
item_id: "Skip",
name: "Skip this Doc",
},
{
type: "button",
item_id: "Abrt",
name: "Cancel",
},
(continued)
.
.
.
.
var DoNumActionDlg = app.trustedFunction(function()
{
app.beginPriv();
return app.execDialog(global.DocNumAction);
app.endPriv();
});
// Setup
var oDoc = event.target;
if(oDoc.xfa)
{
if(3 == app.alert(oDoc.documentFileName + ": is a LiveCycle Form, which cannot be labeled\n\n Do you want to continue processing files? (Pressing No will Abort the file processing)",1,2))
event.rc = false;
}
else
{
global.DocNumAction.bHidden = oDoc.hidden;
if(!oDoc.hidden)
global.DocNumAction.nCurPage = oDoc.pageNum;
else
global.DocNumAction.nCurPage = 0;
global.DocNumAction.nNumPages = oDoc.numPages;
global.DocNumAction.strFileName = oDoc.documentFileName;
var cRtn = DoNumActionDlg();
if("ok" == cRtn)
{
// Setup Initial Doc Number
if(global.DocNumAction.bIncludePageNum)
global.DocNumAction.nCurrentDocNum = Number(global.DocNumAction.strInitDocNum);
console.println("Do " + oDoc.documentFileName);
global.DoPlaceDocNumbers(oDoc);
// Increment Doc Number if applicable
if(global.DocNumAction.bIncludeDocNum)
{
global.DocNumAction.nCurrentDocNum++;
global.DocNumAction.strInitDocNum = global.DocNumAction.nCurrentDocNum.toString();
}
}
else if("Abrt" == cRtn)
event.rc = false;
}
