Quantcast

Strategy for updating multiple templates with ajax

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Strategy for updating multiple templates with ajax

Mike Sickler
I have two templates in a traditional master-detail page. Are there strategies for updating both the master page and the detail when the detail page is edited? It seems that with g:formRemote and g:submitToRemote, I can only specify one update target div.

Thanks,
Mike
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Strategy for updating multiple templates with ajax

Robert Fletcher
What I've done in similar situations is to have the ajax call update
one of the target divs with content that includes a script snippet
that re-fetches the other target div. This makes sense if you're
talking about different content being updated in each div. If so it's
hard to see how else you could do it as the controller action can only
render a single response. If for some reason the same content is
updated in both places you could use Ajax.Request instead of
Ajax.Updater and hand-roll the code for updating the divs with the
response content, it wouldn't be that hard.

Cheers,
Rob

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...