I am having the same problem and can't seem to find anyone else
complaining about it. I've spent a bit of time looking into it.

Cake parses the $_POST data array expecting it to contain:
{"data" => {"field1" => "some_text", "field2" => "some_text"}}.
The "data" array is copied into $this->data for your controller to
use.

To make this work, $html->input tends to create input elements with
the name attribute:
name="data[ModelName][FieldName]"
So you do end up with a correctly formed $_POST array.

The scriptaculous in place editor is a bit dodgy in that you can't
control the name attribute of the edit element it creates. It ALWAYS
creates one with the name "value". So your post data array $_POST will
contain {"value" => "some_text"}. Thus, when cake tries to find a
field in your array named data (containing a data array) it can't.
This causes the problem where are seeing where $this->data is always
empty.

As far as I can tell, the Ajax Helper in Cake is broken because of the
way Scriptaculous is designed. I'm thinking I might post this on the
Cake site as a bug and see what happens. But, I've got stuff to get
done, so I'll probably just hack Scriptaculous and the Ajax helper.

Of course, you could always just read $_POST['value'], but this seems
like a hack to me. It seems like it would be better design to have the
HTML and AJAX helpers exhibit the same behaviour.

On Jul 1, 6:04 am, Mech7 <[EMAIL PROTECTED]> wrote:
> How should i change the form name in the inlineeditor? the default is
> value show it does not come up in $this->data
>
> <?php echo $ajax->editor('title'.$article['Article']['id'], '/admin/
> articles/saveTitle')?>
>
> I tried
>
> <?php echo $ajax->editor('title'.$article['Article']['id'], '/admin/
> articles/saveTitle', array('test' => 'value'))?>
>
> but it does not work :(


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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