<p:ajax> event list?

UI Components for JSF
BigBwana
Posts: 71
Joined: 29 Dec 2011, 03:45

03 May 2012, 04:15

I have been trying to find a matrix of events and what components they can be applied to for <p:ajax> behavior.
For example when adding <p:ajax event="xxxx"> to <p:component>.
Which event type "xxxx" applies to which <p:component>?

Is there any such matrix out there?

I have seen a couple examples in the documentation and in the showcase examples, but not a comprehensive list.

Does one exist?

Thanks
PrimeFaces 3.0 / 3.2, Mobile 0.9.2, Glassfish 3.1.1 (Mojarra 2.1.3), NetBerans 7.1

bayer-dba
Posts: 45
Joined: 19 Dec 2011, 18:07
Location: Hesse, Germany

03 May 2012, 09:42

I havn't found one either yet. AFAIK the only reference is the user's guide.

Perhaps we should take over some workload and create a matrix with the help of the communtiy, e.g. in the Confluence Wiki. See viewtopic.php?f=3&t=17981

Best regards,
Dennis
JBoss 6.2.2; Mojarra 2.1.7; PrimeFaces 3.5 | JBoss 6.2.2; Mojarra 2.2.8; PrimeFaces 5.1.2

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 May 2012, 10:06

User's guide. For example about DataTable see page 141 supported Ajax Behavior Events.

We'll also put this info the vdl to display it while coding via IDE.

BigBwana
Posts: 71
Joined: 29 Dec 2011, 03:45

03 May 2012, 15:50

I found this when working with dataTable in my application.
Also there are a couple more examples in the documentation, but these are component specific events that are directly associated with the specific component.

What I was looking for is a list of events handled by <p:ajax event="xxxx"> AjaxBehavior.

I have noticed that duing the evolution from 2.0 to 3.x, there has been a tendency to migrate some events out of the component itself and rely more on <p:ajax> behavior.

The description in the documentation only really talks about "onchange" and "onclick", and mentions that you can trap client side events to trigger the listener.
However, what I was looking for is a bit more detailed explanation of what actual events can be trapped and for what components.
Can you use <p:ajax> to trap ALL of the client side events associated with the component to trigger the listener or just a subset?

Also, can you use an event in a multiple context?
For example is it valid to have something like:
<p:inputText .... onclick="<javascript code here>" ...>
<p:ajax listener="#{mybean.mylistener}" event="onclick" />
</p:inputText>
PrimeFaces 3.0 / 3.2, Mobile 0.9.2, Glassfish 3.1.1 (Mojarra 2.1.3), NetBerans 7.1

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 May 2012, 17:30

You can always download SOURCES JAR and review the ajax behavior events supported/referenced in source code.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

BigBwana
Posts: 71
Joined: 29 Dec 2011, 03:45

04 May 2012, 02:49

I know that, I was just hoping for something a little more straight forward than looking through source code.

I did find out by trial and error, even thought the documentation mentions the "onclick" event, you need to use the syntax <p:ajax event="click" ... />
The event "omclick" is not a valid event.

Little things like that may be intuitively obvious to people who have gone through the exercise before, but not at all clear for someone who hasn't.
PrimeFaces 3.0 / 3.2, Mobile 0.9.2, Glassfish 3.1.1 (Mojarra 2.1.3), NetBerans 7.1

ClintJCL
Posts: 3
Joined: 27 Mar 2013, 17:16

27 Mar 2013, 17:18

I agree. I am having to add a p:ajax to a p:commandbutton. I have to redeploy to try each event, only to find out it is not supported. I can't find a list of events. Contrary to previous comments, my primefaces user guide (3.4) says nothing about available ajax events on page 141.

I cannot complete my work because I can't launch a function because I can't find the ajax avent.. I don't have the source code nor the time to look through it. I haven't needed it in the past 4 months of primefaces development. I'm on a 2 hour deadline. This primefaces bug was thrown in my face at the last minute. So between your bug, and lack of documentation on how to work around the bug... I look bad, and PrimeFaces looks bad.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

27 Mar 2013, 17:35

Primefaces Elite to the rescue to those on 2 hour deadline and no time to go through source code.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

27 Mar 2013, 17:40

I have to redeploy to try each event,
Why? I don't?
I don't have the source code
It is on the internet, available for EVERYONE I'd say...
nor the time to look
It'll cost you a few minutes... Not much more... If you don't have.... hmmmm
I'm on a 2 hour deadline.
Tight schedule...
This primefaces bug was thrown in my face at the last minute.
What bug?
So between your bug, and lack of documentation on how to work around the bug...
Become a primefaces pro user than and PAY the company to write the documentantion and FIX the (unknown???) bug
I look bad, and PrimeFaces looks bad.
Why does PF look bad? Why do you look bad? If you only have two hours left and cannot fix it, project planning was wrong, the requirements were wrong or something else... Not your fault, or PF's one

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

27 Mar 2013, 17:51

+1 Ronald, nice response!
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests