You can add a PrintForm.js. The library is located in the User Application WAR at this URL: ./javascript/JUICE/form/PrintForm.js. You can optionally do the following:
button to a request or approval form using JavaScript. To add the ability to print a form, add the URL to the JavaScript libraryOpen the print form when doing a submit (after data is validated) by adding the following to the form onload event or one of the field’s onload events:
var action = "SubmitAction"
var pf = new PrintForm(action);
form.interceptAction("SubmitAction", "around", pf.printFormInterceptor,pf);
Figure 6-39 Sample Print Form with a Print Button
To print on an approval action, the code would look like this:
var action = "ApprovalAction";
var pf = new PrintForm(action);
form.interceptAction("ApprovalAction", "around", pf.printFormInterceptor, pf);
Add a
button next to one of the fields on your form by adding this to the field’s onload event:var ctrl = JUICE.UICtrlUtil.getControl(field.getName());var btn = JUICE.UICtrlUtil.addButton(ctrl, "printid", "Print", "Print", "javascript:var p = new PrintForm();p.printFormAfterValidation(\"printid\");");
Figure 6-40 Example Print Button