Documentation: Code sample for showPrintPreview()

//Show this form in print preview
controller.showPrintPreview();
//to print current record only
//controller.showPrintPreview(true);

It would be useful to mention in the code sample that you have to create an “onClose” method for the form to close the print preview.
I can see from the forum I’m not the only one who has wondered why the “close” button does not ‘work’.

The close button should always work, and there is no need for a method called “onClose”, can you reproduce this behaviour in a small smaple solution?

I have since upgraded from 2.2rc3 to 2.2rc5 and it is now working fine without the onClose method.