Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

jsf - How can I get a PrimeFaces widgetVar function list?

Can someone redirect me to a web resource, where I can find list of all widgetVar JavaScript functions list, eg. toggle(), show(), hide () etc etc.

Appreciate your response.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Before PrimeFaces 10

You can find the JavaScript sources of all widgets at GitHub. For example: datatable.js.

You can also open your browser's JavaScript console and type:

PF('yourWidget').__proto__

That will give you the properties list (including functions). Try it at http://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml

PF('customersTable').__proto__

In Chrome this results in an object with collapsible nodes:

▼ c {SORT_ORDER: Object}
  ? SORT_ORDER: Object
  ? _render: function()
  ? addGhostRow: function()
  ? addResizers: function()
  ? addRow: function()
  ? addSelection: function(a)
  ? addSortMeta: function(a)
  ...

Also, next to the showcase there is also documentation you should have a look at. For many components the client side API is well documented, see for example: https://primefaces.github.io/primefaces/8_0/#/components/datatable?id=client-side-api

PrimeFaces 10 and up

From PrimeFaces 10 there is dedicated PrimeFaces JavaScript API documentation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...