I've searched the Internet and I cannot find a list of <p:ajax>
events. Can anyone provide a complete list of events for the <p:ajax>
tag?
I'm particularly interested if there is an onblur
event or something similar.
This attribute is used to trigger event on the specified method. We can pass onclick, keyup etc events in this attribute. Default client side event for input component is onchange.
ajaxComplete GlobalEvent This event behaves the same as the complete event and will be triggered every time an Ajax request finishes.
You might want to look at "JavaScript HTML DOM Events" for a general overview of events:
http://www.w3schools.com/jsref/dom_obj_event.asp
PrimeFaces is built on jQuery, so here's jQuery's "Events" documentation:
http://api.jquery.com/category/events/
http://api.jquery.com/category/events/form-events/
http://api.jquery.com/category/events/keyboard-events/
http://api.jquery.com/category/events/mouse-events/
http://api.jquery.com/category/events/browser-events/
Below, I've listed some of the more common events, with comments about where they can be used (taken from jQuery documentation).
Mouse Events
(Any HTML element can receive these events.)
click
dblclick
mousedown
mousemove
mouseover
mouseout
mouseup
Keyboard Events
(These events can be attached to any element, but the event is only sent to the element that has the focus. Focusable elements can vary between browsers, but form elements can always get focus so are reasonable candidates for these event types.)
keydown
keypress
keyup
Form Events
blur
(In recent browsers, the domain of the event has been extended to include all element types.)
change
(This event is limited to <input>
elements, <textarea>
boxes and <select>
elements.)
focus
(This event is implicitly applicable to a limited set of elements, such as form elements (<input>
, <select>
, etc.) and links (<a href>
). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.)
select
(This event is limited to <input type="text">
fields and <textarea>
boxes.)
submit
(It can only be attached to <form>
elements.)
You can search for "Ajax Behavior Events" in PrimeFaces User's Guide, and you will find plenty of them for all supported components. That's also what PrimeFaces lead Optimus Prime suggest to do in this related question at the PrimeFaces forum <p:ajax>
event list?
There is no onblur
event, that's the HTML attribute name, but there is a blur
event. It's just without the "on" prefix like as the HTML attribute name. You can also look at all "on*" attributes of the tag documentation of the component in question to see which are all available, e.g. <p:inputText>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With