Hi everyone! I'm using ajax poll component on page, and i want to start the polling after click on a certain button, and stop it after job on the server ist finished.
To stop the polling i know that i can use for exp: requestContext.addCallbackParam, but what i have to do, to make the poll component not starting after the page load?
PS. i'm using 2.0.1SNAPSHOT with tomcat 6.20 and mojarra2.0 jsf implementation.
How to start ajaxPoll after click.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Hi,
There is start and stop client side API. See example;
http://www.primefaces.org:8080/prime-sh ... rtStop.jsf
But I don't think it is just enough, you need an attribute like autoStart right where you can set to false for your poll so that it will start whenever you want it using client side API?
There is start and stop client side API. See example;
http://www.primefaces.org:8080/prime-sh ... rtStop.jsf
But I don't think it is just enough, you need an attribute like autoStart right where you can set to false for your poll so that it will start whenever you want it using client side API?
Exactly!I need autostart="false" attribute in poll component, but how to do that? I'm new in Primefaces, and also not advanced in JSF at all. Any suggestion where to start?
I did try with this script (included in body and in head section of the page):
to stop the poll just after the page is loaded, but it did not help. Firebug showed me that the script was invoked, but polling didn't stop.
I did try with this script (included in body and in head section of the page):
Code: Select all
<script type="txt/javascript">PrimeFaces.onContentReady('myPollComponent', function(){myPollComponent.stop()})</script>
to stop the poll just after the page is loaded, but it did not help. Firebug showed me that the script was invoked, but polling didn't stop.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
This needs to be handled on PrimeFaces side so I've created a ticket;
http://code.google.com/p/primefaces/iss ... ail?id=610
Star the issue if you'd like to get notifications.
Probably this change will be ready by monday next week and then you can get it in a nightly build so stay tuned a bit
http://code.google.com/p/primefaces/iss ... ail?id=610
Star the issue if you'd like to get notifications.
Probably this change will be ready by monday next week and then you can get it in a nightly build so stay tuned a bit
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Thank you, I'd appreciate when you have time, write a short testimonial so we can put it our homepage.
http://primefaces.prime.com.tr/forum/vi ... ?f=3&t=531
I'll also update this post when autoStart feature is added.
http://primefaces.prime.com.tr/forum/vi ... ?f=3&t=531
I'll also update this post when autoStart feature is added.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Good news, this feature is added.
You just need to set autoStart to false.
And then on demand, you can start polling with mypoll.start() and mypoll.stop() javascript api.
You would need a nightly build to get this feature.
You just need to set autoStart to false.
Code: Select all
<p:poll autoStart="false" widgetVar="mypoll" />
You would need a nightly build to get this feature.
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 22 guests