PF 函数在 Primefaces 中有什么作用? [英] What does the PF function do in Primefaces?

查看:33
本文介绍了PF 函数在 Primefaces 中有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在很多地方都可以找到函数 PF 与 Primefaces 的用法.例如在这个答案

On many places one can find usage of a function PF with Primefaces. For example in this answer

从我目前看到的情况来看,它似乎是一个神奇的让它工作得更好"的功能.但我不相信这种东西,所以:

From what I have seen so far it seems to be a magic "make it work a little better" function. But I don't believe in this kind of stuff so:

这个函数有什么作用?

我在哪里可以找到有关它的文档?

And where can I find documentation about it?

推荐答案

PF 是一个 Javascript 函数.

PF is a Javascript function.

在 Primefaces 4.0 中,小部件的 Javascript 范围发生了变化.在 4.0 版之前,您可以使用 widgetVar.show(); 打开对话框小部件.

In Primefaces 4.0 the Javascript scope of widgets changed. Prior to version 4.0 you could open a dialog widget with widgetVar.show();.

在 Primefaces 4.0 及更高版本中,小部件存储在 Javascript 小部件数组中.当您调用 PF('widgetVar') 时,它会在数组中查找小部件并返回它.

In Primefaces 4.0 and above the widgets are stored in a Javascript widget array. When you call PF('widgetVar') it is looking for the widget in the array and returning it.

PF=function(d){
    var c=b.widgets[d];
    if(!c){
        if(a.console&&console.log){
            console.log("Widget for var '"+d+"' not available!")
        }
        b.error("Widget for var '"+d+"' not available!")
    }
    return c
};

我找不到太多关于这方面的信息,这也是我使用 Chrome 的开发人员工具能够破译的内容.

I could not find much on this either this is what I was able to decipher using Chrome's developer tools.

这篇关于PF 函数在 Primefaces 中有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆