Well, with saveField you sace only one field of the current record.
Depends what you want to do, if you want to update an existing record,
you need the id and do something like :

$this->Cm->set(array('id'  => $varId));
$this->CM->saveField( ...);

But I haven't tried, maybe it creates a new record as well..

$this->Cm->set(array('id' => ''));
$this->Cm->saveField;

Otherwise for a new record , just use save that would create it

Franck

On Dec 5, 7:40 pm, "das88" <[EMAIL PROTECTED]> wrote:
> I'm pretty new to Cake, so forgive me if I ask something really stupid.
>
> I would like to do an Ajax update to a different table than my current
> model, but I can't figure out how to this.
>
> My view does a POST like
> field   Common_Name
> id      2
> value   test_value
>
> The name of the table is stored in a Session variable (different for
> each user)
> $this->Session->read('dataset'))
>
> My Model is called Cm, and just looks like
> <?php
> class Cm extends AppModel
> {
>     var $name = 'Cm';}?>
>
> I post to /cms/update, and have a controller like
> <?php
> class CmsController extends AppController
> {
>     var $name = 'Cms';
>     var $helpers = array('Html', 'Head');
>
>     function update() {
>     $this->layout = 'ajax';
>
>     $this->Cm->useTable=$this->Session->read('dataset'));
>
> $this->Cm->saveField($this->params['form']['field'],$this->params['form']['value']);
> 
> }Nothing seems to happen.


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