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

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

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 :
#2

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.

greg