firelex
firelex

Reputation: 129

Typo3: Extbase extension: How can view be reloaded every 20 seconds?

I have an Extbase extension starting some background activities. To monitor the overall progress, there is a view displaying current state. How can this view be reloaded, say every 10-15 seconds? The best thing was to reload only this part of the page.

Upvotes: 1

Views: 879

Answers (1)

Jost
Jost

Reputation: 5840

Use AJAX. To get the result of a specific action instead of the whole page, you can use the extension typoscript_rendering - it's made for this exact purpose.

To use it, you need to do something along these lines:

  1. Create a controller action that renders the output you want to use for reloading.
  2. In the fluid template where you want to reload the output, render the URL to use for rendering that output using the ViewHelper helhum:uri.ajaxAction from the above-mentioned extension. Put it into some data-attribute or something.
  3. Fetch the content at that URL using AJAX - if you need adapt parameters for each call, it's probably best to do POST requests. You need to implement this manually - TYPO3 does not come with prebuilt JS for this.

Upvotes: 1

Related Questions