Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

An object that can be used to emulate classes and a class hierarchy in JavaScript. This works even for old browsers that do no support the native class syntax yet. Note however, that this should be mostly compatible with the new class syntax of JavaScript, so consider creating your own widgets as a class:

class MyWidget extends PrimeFaces.widget.BaseWidget {
init(cfg){
// ...
}
}

Note to TypeScript users: You will need to specify the type parameters explicitly. The best way to do so is by defining the interfaces for the classes separately:

interface BaseWidgetCfg {
prop1: string;
}
interface AccordionPanelCfg extends BaseWidgetCfg {
prop2: boolean;
}
interface BaseWidget {
init(cfg: BaseWidgetCfg): void;
method1(x: number): boolean;
}
interface Accordion extends BaseWidget {
init(cfg: AccordionPanelCfg): void;
method1(): boolean;
method2(): boolean;
}

Now you can use it normally:

const BaseWidget = Class.extend<BaseWidget, [BaseWidgetCfg]>({
init(cfg: BaseWidgetCfg) {
// ...
},
method1(x: number): boolean {
return x > 0;
},
});
const Accordion = BaseWidget.extend<Accordion, [AccordionCfg]>({
init(cfg: AccordionCfg) {
this._super(cfg);
},
method1() {
return !this._super(42);
},
method2() {
return true;
}
});
const base: BaseWidget = new BaseWidget({prop1: ""});
const accordion: Accordion = new Accordion({prop1: "", prop2: true});
base.method1(2);
accordion.method1();
accordion.method2();
Date: DateConstructor

The globally available constructor for the Quill text editor used by the TextEditor widget.

jQBrowser: BrowserInspector

Contains information about the current browser environment, such as which browser the user is using etc.

Functions

  • Finds and returns a widget

    Note to typescript users: You should define a method that takes a widget variables and widget constructor, and check whether the widget is of the given type. If so, you can return the widget and cast it to the desired type:

    function getWidget<T extends PrimeFaces.widget.BaseWidget>(widgetVar, widgetClass: new() => T): T | undefined {
    const widget = PrimeFaces.widget[widgetVar];
    return widget !== undefined && widget instanceof constructor ? widgetClass : undefined;
    }

    Parameters

    • widgetVar: string

      The widget variable of a widget.

    Returns BaseWidget | undefined

    The widget instance, or undefined if no such widget exists currently.

  • autosize<TElement>(element: TElement): TElement
  • Autosize is a small, stand-alone script to automatically adjust textarea height to fit text. Attaches autosize to the given element or elements.

    Type Parameters

    Parameters

    • element: TElement

      The TEXTAREA element to which to attach autosize.

    Returns TElement

  • Exposes the Print.js library as a global variable. Normally you do not have to use this yourself, as PrimeFaces calls it for you when you use the printer component. Also note that while PrimeFaces currently uses this library for printing, this is subject to change in future releases.

    Parameters

    Returns void

  • Exposes the Print.js library as a global variable. Normally you do not have to use this yourself, as PrimeFaces calls it for you when you use the printer component. Also note that while PrimeFaces currently uses this library for printing, this is subject to change in future releases.

    Parameters

    Returns void

Generated using TypeDoc