-
Notifications
You must be signed in to change notification settings - Fork 17
WPrintButton
WPrintButton is a component for printing the current screen. It is a client-only print and the output is determined by the user's print and browser settings.
WPrintButton has two constructors: use of the default constructor will result in the default text (Print
in English) being set on the button.
// a default WPrintButton
WPrintButton button = new WButton();
// a WPrintButton with a specific text label
WButton button = new WButton("Print this page");
WPrintButton will be accessible if it is created with a reasonable labelling string - even if this string is not displayed on the final button because an image is displayed as the only content of the button.
WPrintButton printButton = new WPrintButton("Print");
At a bare minimum a WPrintButton must have at least one of:
- a displayed text label (preferred);
- a toolTip which adequately describes the purpose of the button; or
- setting the accessibleText property to a value which adequately describes the purpose of the button.
For detailed information and methods to ensure your WPrintButtons are always accessible see WButton accessibility.
A WPrintButton may be given an access key to provide rapid keyboard access.
See toolTip.
WPrintButton will output a HTML button element. This is an interactive, form bound control and therefore may not be used in any context where the content model forbids this content category. The allowed content of WPrintButton is a String label and optional image.
Refer to the information on WButton for more details about creating and adding content to a WPrintButton and the properties available. The following aspects of WButton are not applicable to WPrintButton:
- WPrintButton may not be associated with an Action, ValidatingAction or UI command.
- Invocation confirmation using either the cancel property or msg property is not possible (or required) with WPrintButton.
- WPrintButton may not act as a trigger for a WAjaxControl, WPopup or WDialog.