a4j:support has a requestDelay attribute where you can define the delay.
I will give you an example so the requsts to became more clear:
i have the next fragment loaded (it is loaded with ajax, not with the whole page )
<a4j:outputPanel id="myCenterPanel"> text to be before.... text to be after... </a4j:outputPanel>
and after n millisecounds i have to obtain the next fragment without rerendering the "text to be before...." and "text to be after..." text:
<a4j:outputPanel id="myCenterPanel"> text to be before.... <a4j:outputPanel id="myRows"> <!-- delayed loaded fragment --> item1 item2 ...... </a4j:outputPanel> text to be after... </a4j:outputPanel>
Another question related to this problem:
How can you make a zone not rendered at the begining and render it after an event from a4j? I tried to add to this zone rendered=false and then in another component reRender=MyZone, and it doesent work. If i let it to rendered=true it is shown/loaded from the begining.
You should not point with reRender to the component that might have rendered="false". Point to one of the parent component is a right way to go.
I mentioned the reason several times. So, it looks like a good candidate for FAQ.
Delivering the update, but applying it with timeout is not a future of ajax4jsf. I see only the way with second ajax request triggered by oncomplete
BWT, what is the problem with oncomplete you spoke about?
It could work this way but i need a zone that is not render initial and to render it after an event (in this case the delayed onload). Is the only way to do this by keeping a flag on the server and send the content only on the second request of the zone, or can the ajax4jsf do this?
It would be useful if ajax4jsf could split some parts of a rendered zone (split defined by user) to be rendered in background later use.
I know that the timeout is used for skipping multiple requests, but is a good thing when you want to do exotic stuff like my problem. I would be happy if would be included in next releases.
Sorry about the oncomplete i tried myself and is working, seems i was misinformed :)
You can use a a4j:poll to get the requested behaviour:
<a4j:poll id="pollerId" reRender="whatToRerender" limitToList="true" interval="5000" ajaxSingle="true" />
The trick is to set limitToList to "true", but _not_ include the ID of the poller in it's reRender list.
This way, the reRender will fire once after the specified interval.
Works for me.