Simple answer is : it is impossible to update multiple divs with
different content with one call to a controller in the way I think you
are thing (I have two possible solutions I'll get to shortly)
Think about the flow:
ajax->submit requests a document or portion of page from the server what
is returned is one document, the update option tells which div to put
that document into.
What I think you want is to update an additional div with some other
content if I'm right then:
Solution 1:
The controller action returns one document containing both divs
Use CSS positioning to define where update1 and update2 are on the page
if they aren't adjacent.
If you have:
<div id="container">
<div id="update1">
Content1
</div>
<div id="update2">
</div>
</div>
then ajax->submit should update "container" and the controller action
should render a view <div id="update1>....<div id="update2">.....
Solution2:
ajax submit updates one of the divs and use the before or after options
of the ajax->submit to call an additional javascript function that
updates the other one.
I don't want to double post but this same answer applies to the Thread
with subject "AJAX Update DIVs in two layouts" in fact apart from the
wording the question is precisely the same one.
Regards
Jeremy
Now would some kind soul please answer my question from a few days ago ;-)
Dakapo wrote:
> Hello!
>
> Since hours I'm trying to update two divs after a submit via ajax.
> The first layer contains a view-file (edit.thtml)
> The second one should get rendered from an element.
>
> But only the edit.thtml gets updated. I must misunderstand something
> with the Cake-Ajax-Handling but I don't know what. I would be so
> thankful if somebody could help me.
>
> You can find the code under http://bin.cakephp.org/view/648753697
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---