What does the PF function do in Primefaces

The PF function is a part of PrimeFaces's JavaScript API. It looks up a Javascript object that is the backbone of the JSF component on the client-side. Here is its definition (source):

PF = function(widgetVar) {      
        var widgetInstance = PrimeFaces.widgets[widgetVar];

        if (!widgetInstance) {
            PrimeFaces.error("Widget for var '" + widgetVar + "' not available!");
        }

        return widgetInstance;
    };

PF is a shortcut for PrimeFaces.widgets['someWidgetId'], which just looks-up a Javascript object in global scope, and so the Javascript object can also be retrieved using window['someWidgetId'].

The PrimeFaces's Javascript API has no official documentation online, so to understand what you can really "do" with the Javascript object, you'll need to take a deep dive into PrimeFaces.

See also

阅读更多
文章标签: Primefaces
个人分类: Primefaces
上一篇How can i get access to a Highcharts chart through a DOM-Container
下一篇PrimeFaces 核心源码 js
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭