What does the PF function do in Primefaces

转载 2015年11月19日 22:51:19

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 核心源码 js

primefaces/src/main/resources/META-INF/resources/primefaces/core/core.js  (function(window) { ...
  • DViewer
  • DViewer
  • 2015年11月19日 23:10
  • 1073

What Does __read_mostly In The Linux Kernel Do?

If you have spent any time looking at Linux kernel code you have undoubtedly come across the__read_m...

What does ContextLoaderListener do in Spring?

In web.xml, there is usually the following line     org.springframework.web.context.ContextLoader...
  • DViewer
  • DViewer
  • 2016年02月19日 17:40
  • 240

[stackoverflow翻译] “yield” 关键字有什么用?what-does-the-yield-keyword-do

问: 在Python中 yield 关键字有什么用? 他是做什么的? 例如,我正在尝试理解下面的代码1: def _get_child_candidates(self, distance, mi...

ExpressJs - 04 - what does express.static(__dirname) point do?

In Node, the __dirname is a global object that contains the name of the directory that the executing...

What does the “yield” keyword do? (转)

原文链接:stackoverflow.com/questions/231767/what-does-the-yield-keyword-do To understand what yield doe...
  • L_unter
  • L_unter
  • 2017年02月03日 15:03
  • 62

What Does The HANDLECOLLISIONS Parameter Do? [ID 966207.1]

In this Document Goal Solution Explanation of HANDLECOLLISIONS HANDLECOLLISIONS and PKUPDATE...

What does functools.wraps do?

In a comment on the answer to another question, someone said they weren't sure what functools.wraps...

What does (Aborted) mean in HttpWatch?

What does (Aborted) mean in HttpWatch?The result column in HttpWatch may sometimes display the value...
  • jawiudi
  • jawiudi
  • 2011年05月06日 19:54
  • 710
您举报文章:What does the PF function do in Primefaces