Both f:ajax and p:ajax queue their requests on the browser and execute them sequentially. This means that the browser waits for one ajax request to complete before sending the next one. However, when both f:ajax and p:ajax are used on the same page, there are two request queues, not one. f:ajax and p:ajax use different request queues. This means that f:ajax and p:ajax requests can be executed concurrently.
What is the easiest way to avoid this, and ensure that f:ajax and p:ajax requests are not executed concurrently?
f:ajax and p:ajax request queues
- gmaldonadonaval
- Posts: 6
- Joined: 01 Dec 2010, 03:53
- Location: Mexico, Jalisco, Guadalajara
I needed before do something like you, but at the end I used the same technology in the page, I used f:ajax only.
Can you put your example please? I wants understand what do you want to do.
Can you put your example please? I wants understand what do you want to do.
Autobot
Java Architect
Primefaces 2.2 RC2, Mojarra 2.0.3, Tomcat 6.0, JSF 2.0
Java Architect
Primefaces 2.2 RC2, Mojarra 2.0.3, Tomcat 6.0, JSF 2.0
Good evening Mexico ,
I have a few composite components I wrote myself that use f:ajax internally. I'm using these components on a page with PrimeFaces components that, naturally enough, use p:ajax internally. Most of the time everything functions correctly, however, there can be problems when the user clicks something that fires an f:ajax request when a different part of the page using p:ajax is still being processed/executed. This is happening because the different technologies are using different ajax queues that are not synchronized.
I'd imagine that my only option at the moment is to do what you suggest, i.e., use the same technology. I can't modify the PrimeFaces components to use f:ajax, so I have to modify my components to used p:ajax.
I somehow feel that something isn't quite right here though. IMHO there should only be one queue for all ajax requests from all components, no matter what person or component library the components are from.
I have a few composite components I wrote myself that use f:ajax internally. I'm using these components on a page with PrimeFaces components that, naturally enough, use p:ajax internally. Most of the time everything functions correctly, however, there can be problems when the user clicks something that fires an f:ajax request when a different part of the page using p:ajax is still being processed/executed. This is happening because the different technologies are using different ajax queues that are not synchronized.
I'd imagine that my only option at the moment is to do what you suggest, i.e., use the same technology. I can't modify the PrimeFaces components to use f:ajax, so I have to modify my components to used p:ajax.
I somehow feel that something isn't quite right here though. IMHO there should only be one queue for all ajax requests from all components, no matter what person or component library the components are from.
- gmaldonadonaval
- Posts: 6
- Joined: 01 Dec 2010, 03:53
- Location: Mexico, Jalisco, Guadalajara
Sorry but I don't have any other solution, you need change your components to use p:ajax.
Richfaces created a AJAX queue to solve this problem but that solution imply more work and research.
In javascript if you create two instances of ajax objects you have two diferents channels then JSF creates their own channel like Primefaces.
When you mix two or more AJAX technologies is a headache
Richfaces created a AJAX queue to solve this problem but that solution imply more work and research.
In javascript if you create two instances of ajax objects you have two diferents channels then JSF creates their own channel like Primefaces.
When you mix two or more AJAX technologies is a headache
Autobot
Java Architect
Primefaces 2.2 RC2, Mojarra 2.0.3, Tomcat 6.0, JSF 2.0
Java Architect
Primefaces 2.2 RC2, Mojarra 2.0.3, Tomcat 6.0, JSF 2.0
Hi,
I set for all my p:ajax calls async="true" und don't have problem anymore . Queued or not queued requests - doesn't really matter in practice (from my point of view).
I set for all my p:ajax calls async="true" und don't have problem anymore . Queued or not queued requests - doesn't really matter in practice (from my point of view).
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
- bumble.bee
- Posts: 723
- Joined: 29 Sep 2010, 21:39
- Location: United States
I'd vote for that. Is there an issue ticket?
For bumble.bee and anyone else who would like to see this fixed, here's the issue to vote for: http://code.google.com/p/primefaces/iss ... il?id=1762
-
- Information
-
Who is online
Users browsing this forum: No registered users and 50 guests