I've been thinking on this too. I didn't want to write 2 different
views, one for the whole index page and one just for the updated table.
I did sth. like this.

<? if([EMAIL PROTECTED]){?>
<html>
<head> .....</head>
<body>
bla bla bla
<div id="updatable">
<?}?>

    the content which will be updated

<? if([EMAIL PROTECTED]){?>
</div>
<div id="footer"> ....
</body>
</html>
<?}?>

And i have 2 actions in the controller in which i initialize the data
and set the $ajax_call to false or true. So the 'index' action renders
the whole html and the 'index_update' action renders the same file
'index.thtml' ($this->render('index')) and updates the 'updatable'
<div>.

Also.. if you want you can do this just in one action with extra
parametes:
 function index($update = false){
   init();
   if($update){$this->set('ajax_call',true)}
   else{$this->set('ajax_call',false)}
}


You should know that i'm a beginner so... what i'm saying is a way to
deal with ajax updates, but i'm not sure that this is the right way.

the good thing in this method is that you change only one view an one
action


--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to