您的位置:首页 > 其它

What does the PF function do in Primefaces

2015-11-19 22:51 656 查看
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

"Intro
To PrimeFaces widgetVar" blog post
PrimeFaces
source code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Primefaces