Reloading widget with viaAjax()

Asked by Tim

My goal is to refresh a widget after a ajax call has been made.

Is it possible to (re)load a widget like this:

    public function viaAJAX() {
        $this->template->requestAjax('3279223325', 'widget1', 'data=Hello World&moredata=Foobar');

If it is not possible: Is the best solution creating a new ajax request for it? Which doesnt have to be a problem at all, but I just want to prevent making more functions/calls as necessary.

Thanks in advance.

Question information

English Edit question
PHPDevShell Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Tim (timhagebols-3) said :

I dove into the system code and it is not possible. Solving it with a new ajax request. Srry for the inconvenience.

Revision history for this message
Greg (gregfr) said :

You have a perfectly valid point.
It should be possible to do what you want by encapsulating both replies (your ajax and the widget's) into a single request. But it's probably not worth it, because it's quite complicated, and with the adoption of spdy it would probably be useless.

You could also consider by-passing the widget way and implement your own single request passing back the parameters, and the corresponding action in JS. Being worth it depends on your situation.