Re: $ajax->editor help
Works like a charm, thank you for suggesting that link. I might put a comment in the manual as it doesn't seem to mention: $this->params['form']['value'] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $ajax->editor help
double07, This article discusses exactly what you need - http://bakery.cakephp.org/articles/view/using-the-ajax-helper-for-inplaceeditor-and-inplacecollectioneditor-fields Pay close attention, when Paul goes over ajax_update. That's the action that will the posted form data. -teh On May 21, 9:52 pm, double07 wrote: > Hi All, > > I'm currently working on a comments section of my site and I'm trying > to allow the comments to be edited via an ajax edit-in-place field. I > can't work out how the data is passed to the controller though and > also how to access that data in the controller... > > In my controller I have: > > function admin_edit() { > $this->Comment->saveField('body', ???); > $this->set('comment', ??? ); > $this->layout = 'ajax'; > > } > > In my view I have: > echo '' . $comment['body'] . ' div>'; > echo $ajax->editor( > 'Comment'.$comment['id'], > array( > 'controller' => 'comments', > 'action' => 'admin_edit', > $comment['id'] > ), > array('okText' => 'Save', 'rows' => '4', > 'cols' => '72', > 'highlightcolor' => '#d1eeff', 'highlightendcolor' => '#f4f4f4') > ); > echo ''; > > In the submitted view I have: > > > I can't work out what I'm supposed to put where the question marks > are. In my searching high and low for an answer I came across a > similar post on these groups saying that the data is available in the > controller via $this->params['formname']['field'] - so does this mean > that I have to put the $ajax->editor inside a form? If not how do I > know what the ajax form/field is named??? > > Thanks, > > -Brett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$ajax->editor help
Hi All, I'm currently working on a comments section of my site and I'm trying to allow the comments to be edited via an ajax edit-in-place field. I can't work out how the data is passed to the controller though and also how to access that data in the controller... In my controller I have: function admin_edit() { $this->Comment->saveField('body', ???); $this->set('comment', ??? ); $this->layout = 'ajax'; } In my view I have: echo '' . $comment['body'] . ''; echo $ajax->editor( 'Comment'.$comment['id'], array( 'controller' => 'comments', 'action' => 'admin_edit', $comment['id'] ), array('okText' => 'Save', 'rows' => '4', 'cols' => '72', 'highlightcolor' => '#d1eeff', 'highlightendcolor' => '#f4f4f4') ); echo ''; In the submitted view I have: I can't work out what I'm supposed to put where the question marks are. In my searching high and low for an answer I came across a similar post on these groups saying that the data is available in the controller via $this->params['formname']['field'] - so does this mean that I have to put the $ajax->editor inside a form? If not how do I know what the ajax form/field is named??? Thanks, -Brett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Ajax editor + datepicker?
Can anyone suggest a way for me to use the ajax editor (or something like it), so that when you click on the field you can either edit it directly or use a datepicker widget? Thanks! al --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ajax editor
SOLVED! it turns out that you can not have any spaces in the code if you want it to choose a input type=text instead of a textarea. So if your code looks like this Titile txt here you will get a text area if it is this Titile txt here you should get a input type=text area instead. On Sep 15, 10:20 pm, sfmerv <[EMAIL PROTECTED]> wrote: > I have a small problem with the ajax editor. Everything works fine in > terms of updating and returning the proper value. > > Here is the problem. I want the editor to load a input text field > instead of a textarea when the user clicks on the the text they want > to edit. Is there a way to set it? Also I want to edit the look of the > form, is it best to do that in css? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
Broken Ajax->editor in 1.2 svn
Hello everyone. Just want to give a heads up that the AjaxHelper::editor function is broken when using a collection. The helper creates the collection part like this: collection:{"1":"Value 1","2":"Value 2", ...} while it should be this way: collection: [["1", "Value 1"], ["2", "Value 2"], ...] For now, I'm writing it by hand (since I don't want to mess with the cake core as my repository is automagically updated via svn). Regards, - LS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
ajax->editor
Hi I used the $ajax->editor in my view. Now I use the option 'complete'. But then I used this option I can use the editor only for the first time then the editor doesn't work. Can anybody help me? I post my code: Title editor('title', 'ajax_update',array('size'=>40,'complete'=>'alert(1)')); ?> Many Thanks Marco --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: $ajax->editor
Realised my errror, I forgot to add $this->autoRender=false; to my function. Harro On Oct 22, 1:32 am, Harro <[EMAIL PROTECTED]> wrote: > Is there something I am missing here, I am trying to use the editor > helper to create an edit in place text field. > I am using this: > > editor('text_1', 'change'); ?> > > However when I click the ok button to send the request via ajax, I get > the missing view error for the change() function, shouldn't it just > send the request to the function and not require a view? > > Thanks for any help, Harro. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$ajax->editor
Is there something I am missing here, I am trying to use the editor helper to create an edit in place text field. I am using this: editor('text_1', 'change'); ?> However when I click the ok button to send the request via ajax, I get the missing view error for the change() function, shouldn't it just send the request to the function and not require a view? Thanks for any help, Harro. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax->editor and saving just one field
OK got this working - not sure its the *best* way though In your view: editor('edit-address','update?name=address&id='. $participant['Participant']['id']); ?> i.e. use the GET param to pass through an id and the field name In your controller: $this->autoRender = false; if(!empty($this->params['form'])) { $value = $this->params['form']['value']; $this->Participant->id = $_GET['id']; $name = $_GET['name']; if($this->Participant->saveField($name, $value)){ echo $value; } else { echo "bad ass"; // not sure how to debug yet! } exit; } hth will On Jul 31, 9:08 am, willard <[EMAIL PROTECTED]> wrote: > Apologies for the slightly newbie email - Im finding my way around the > cake API a little tricky > > Basically I'm trying to do inplace editing. Key elements (if you are > coming across this post looking as to how to do it) are: > 1. > charsetTag('UTF-8'); ?> > link('prototype'); ?> > link('scriptaculous.js? > load=effects,controls'); ?> in the default layout > 2. ['parent1_name']?>editor('edit- > parent1_name','update/'); ?> in your view. > > which provides a simple onmouseover -> text box for the text to be > edited. > However I cant debug what the heck cake is receiving and thus I cant > try and save anything. > > In my controller: > function update(){ > // $this->Participant->save($this->data['Participant']); > $this->render('done', 'ajax'); > } > > - How do I get the Participant model to save just one field - not the > whole model? Im guessing something like > $this->Participant->save($this->data['Participant'] > ['parent1_name''],'parent1_name'') > ? > > Any ideas??? > Anyone know of a demo of the inplace editor and cake being used at > all? > > Thanks! > > Will --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ajax->editor and saving just one field
Apologies for the slightly newbie email - Im finding my way around the cake API a little tricky Basically I'm trying to do inplace editing. Key elements (if you are coming across this post looking as to how to do it) are: 1. charsetTag('UTF-8'); ?> link('prototype'); ?> link('scriptaculous.js? load=effects,controls'); ?> in the default layout 2. editor('edit- parent1_name','update/'); ?> in your view. which provides a simple onmouseover -> text box for the text to be edited. However I cant debug what the heck cake is receiving and thus I cant try and save anything. In my controller: function update(){ // $this->Participant->save($this->data['Participant']); $this->render('done', 'ajax'); } - How do I get the Participant model to save just one field - not the whole model? Im guessing something like $this->Participant->save($this->data['Participant'] ['parent1_name''],'parent1_name'') ? Any ideas??? Anyone know of a demo of the inplace editor and cake being used at all? Thanks! Will --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: $ajax->editor
See the reply to this post: http://groups.google.com.au/group/cake-php/browse_thread/thread/08e0e496513cfc29/?hl=en# On Jul 10, 7:27 am, Conrad <[EMAIL PROTECTED]> wrote: > Hi, > > I'm semi-new to cake (and php), but trying to learn fast...and I was > wondering how I work with getting the data sent by the ajax editor... > > for instance i the following code in my view: > > editor('email', '/users/edit', > array('callback'=>'return "email=" + escape(value)')) ?> > > When that value is sent to my controller I want it to save it to the > database...do i use $this->data or $this->params['data'] or what? > > Thanks! > Conrad --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$ajax->editor
Hi, I'm semi-new to cake (and php), but trying to learn fast...and I was wondering how I work with getting the data sent by the ajax editor... for instance i the following code in my view: editor('email', '/users/edit', array('callback'=>'return "email=" + escape(value)')) ?> When that value is sent to my controller I want it to save it to the database...do i use $this->data or $this->params['data'] or what? Thanks! Conrad --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax->editor form name?
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 > > editor('title'.$article['Article']['id'], '/admin/ > articles/saveTitle')?> > > I tried > > 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 -~--~~~~--~~--~--~---
ajax->editor form name?
How should i change the form name in the inline editor? the default is value show it does not come up in $this->data editor('title'.$article['Article']['id'], '/admin/ articles/saveTitle')?> I tried 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 -~--~~~~--~~--~--~---
Re: Ajax editor() and wysiwyg editor
I don't thnk either of those support ajax editor at the time. You might want to write a plugin for them. However, TinyMCE is quite heavy since it does a lot of checking and processing (its capabilities is really broad too). You might want to go for a the lite version of TinyMCE and put it in your AjaxEditor Helper. On Mar 16, 10:07 am, "Cavallo" <[EMAIL PROTECTED]> wrote: > Hi > > Is possible to use in $ajax->editor() a wysiwyg (tinymce, FCK,...) ? > And if it is then how ? It would be realy nice if this would be > possible. > > Thanks > > Regards --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Ajax editor() and wysiwyg editor
Not exactly an answer, but http://bakery.cakephp.org/articles/view/60 has an instruction on using TinyMCE in Cake. On Mar 16, 5:07 pm, "Cavallo" <[EMAIL PROTECTED]> wrote: > Hi > > Is possible to use in $ajax->editor() a wysiwyg (tinymce, FCK,...) ? > And if it is then how ? It would be realy nice if this would be > possible. > > Thanks > > Regards --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Ajax editor() and wysiwyg editor
Hi Is possible to use in $ajax->editor() a wysiwyg (tinymce, FCK,...) ? And if it is then how ? It would be realy nice if this would be possible. Thanks Regards --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
Thanks Guys This Group is Really HOT On Mar 4, 9:52 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > On 3/4/07, phirschybar <[EMAIL PROTECTED]> wrote: > > > > > gwoo's method is the way to go. I wouldn't recommend editing the > > webroot/index.php > > The only reason, I don't mind editing my index.php file is because I > only do it on my dev machine ;) in production I have debug set to 0 > so it's not an issue ;) > > Sam D --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
On 3/4/07, phirschybar <[EMAIL PROTECTED]> wrote: > > gwoo's method is the way to go. I wouldn't recommend editing the > webroot/index.php The only reason, I don't mind editing my index.php file is because I only do it on my dev machine ;) in production I have debug set to 0 so it's not an issue ;) Sam D --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
gwoo's method is the way to go. I wouldn't recommend editing the webroot/index.php On Mar 4, 4:23 am, "gwoo" <[EMAIL PROTECTED]> wrote: > this should work too. In AppController or any other Controller. > Remember to include RequestHandler in your components array. > > functon beforeRender() { > if($this->RequestHandler->isAjax() || $this->RequestHandler->isXml()) { > > Configure::write('debug', 0); > } > > } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
this should work too. In AppController or any other Controller. Remember to include RequestHandler in your components array. functon beforeRender() { if($this->RequestHandler->isAjax() || $this->RequestHandler- >isXml()) { Configure::write('debug', 0); } } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
you can also edit your webroot/index.php at the last line add a test for if the request is an ajax one (this is an exercise left up to the reader) and not add the timing line (I do this for xml/rest/soap requests) . On 3/3/07, bernardo <[EMAIL PROTECTED]> wrote: > > > > On Mar 3, 8:45 am, "sanjeevdivekar" <[EMAIL PROTECTED]> wrote: > > Hey, > > > > I am also in same trobule when i edit 2nd time i see "test message" in text box. > > what u do with control.js? > > What you are seeing is the debug timing information that cake php adds > when the debug level is set to 1. Remember that any output generated > will be added to the ajax response. Simply define debug to 0 and > you'll stop seeing it. > > > > > -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
On Mar 3, 8:45 am, "sanjeevdivekar" <[EMAIL PROTECTED]> wrote: > Hey, > > I am also in same trobule when i edit 2nd time i see "test message" in text box. > what u do with control.js? What you are seeing is the debug timing information that cake php adds when the debug level is set to 1. Remember that any output generated will be added to the ajax response. Simply define debug to 0 and you'll stop seeing it. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
Hey, I am also in same trobule when i edit 2nd time i see "test message" in text box. what u do with control.js? On Mar 2, 8:20 pm, "dhalsim" <[EMAIL PROTECTED]> wrote: > I've checked this already but it is not the problem. > So I solve the problem in controls.js from script.aculous lib with a > kindy trim function on the new value. > > On 28 fév, 17:16, "bernardo" <[EMAIL PROTECTED]> wrote: > > > > > Make sure the spaces are not in your source files (before or after the > > php tags) as these spaces will be added to theajaxresponse. > > > On Feb 28, 10:13 am, "dhalsim" <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I've put anajaxeditorin my view and the problem I have is when I > > > edit my field for the second or more time, the value in the text field > > > is prefixed with sereval tabulation (I don't see directly the value in > > > the input). I don't understand where they come from. > > > > this is a piece of my view : > > > > > > > > > > > > editor('ajax_edit_nom','/utilisateurs/ajax_update/'. > > > $user['utilisateurid'].'/nom')); ?> > > > > and my UtilisateursController with the ajax_update() method : > > > > function ajax_update($id,$sub) > > > { > > > $value = $this->params['form']['value']; //new value > > > to save > > > > $this->Utilisateur->id = $id; > > > if (!$this->Utilisateur->saveField($sub, $value, > > > true)) > > > { > > > $this->set('error', true); > > > } > > > $user = $this->Utilisateur->read(array($sub), $id); > > > $this->set('value',$user['Utilisateur'][$sub]); > > > $this->layout = 'ajax'; > > > } > > > > and finally th ajax_update.thtml > > > > > > > If anybody has an idea...- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Ajax->editor Not Taking Options?
OK, I see what has happened. I have v1.7.0 of the script.aculo.us library and and the Ajax helper has not been updated to allow for new options like submitOnBlur. I modified my ajax.php helper to allow the new options i wanted to use and all is well. Carry on. Nothing to see here. On Mar 2, 11:43 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey all, > > I'm fairly new to cake and have no previous experience with ajax, but > I am trying to implement an edit-in-place field. So I have: > > id']); > > When I click on the username field, the text turns into an input box. > However, it's not the right size, and I don't want the OK button and > Cancel link to show up - I'd like the update to occur on blur (i.e. href="http://script.aculo.us/current/test/functional/ > ajax_inplaceeditor_test.html">demo). So, I tried passing various > things like 'submitOnBlur' => true -- > echo $ajax->editor('username_' . $user['User']['id'], '/' . $this->name > . '/ajax_edit_username/' . $user['User']['id'], > > array('submitOnBlur' => true); > > Nothing that I put in the options array shows up when the page loads, > however. When I look at the source of the index, the script for the > editor is still there and still works, but none of the options appear > in the HTML. Any ideas? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Ajax->editor Not Taking Options?
Hey all, I'm fairly new to cake and have no previous experience with ajax, but I am trying to implement an edit-in-place field. So I have: id']); When I click on the username field, the text turns into an input box. However, it's not the right size, and I don't want the OK button and Cancel link to show up - I'd like the update to occur on blur (i.e. http://script.aculo.us/current/test/functional/ ajax_inplaceeditor_test.html">demo). So, I tried passing various things like 'submitOnBlur' => true -- echo $ajax->editor('username_' . $user['User']['id'], '/' . $this- >name . '/ajax_edit_username/' . $user['User']['id'], array('submitOnBlur' => true); Nothing that I put in the options array shows up when the page loads, however. When I look at the source of the index, the script for the editor is still there and still works, but none of the options appear in the HTML. Any ideas? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
I've checked this already but it is not the problem. So I solve the problem in controls.js from script.aculous lib with a kindy trim function on the new value. On 28 fév, 17:16, "bernardo" <[EMAIL PROTECTED]> wrote: > Make sure the spaces are not in your source files (before or after the > php tags) as these spaces will be added to the ajax response. > > On Feb 28, 10:13 am, "dhalsim" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I've put an ajax editor in my view and the problem I have is when I > > edit my field for the second or more time, the value in the text field > > is prefixed with sereval tabulation (I don't see directly the value in > > the input). I don't understand where they come from. > > > this is a piece of my view : > > > > > > > > editor('ajax_edit_nom','/utilisateurs/ajax_update/'. > > $user['utilisateurid'].'/nom')); ?> > > > and my UtilisateursController with the ajax_update() method : > > > function ajax_update($id,$sub) > > { > > $value = $this->params['form']['value']; //new value > > to save > > > $this->Utilisateur->id = $id; > > if (!$this->Utilisateur->saveField($sub, $value, > > true)) > > { > > $this->set('error', true); > > } > > $user = $this->Utilisateur->read(array($sub), $id); > > $this->set('value',$user['Utilisateur'][$sub]); > > $this->layout = 'ajax'; > > } > > > and finally th ajax_update.thtml > > > > > If anybody has an idea... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax editor and view
Make sure the spaces are not in your source files (before or after the php tags) as these spaces will be added to the ajax response. On Feb 28, 10:13 am, "dhalsim" <[EMAIL PROTECTED]> wrote: > Hi, > > I've put an ajax editor in my view and the problem I have is when I > edit my field for the second or more time, the value in the text field > is prefixed with sereval tabulation (I don't see directly the value in > the input). I don't understand where they come from. > > this is a piece of my view : > > > > editor('ajax_edit_nom','/utilisateurs/ajax_update/'. > $user['utilisateurid'].'/nom')); ?> > > and my UtilisateursController with the ajax_update() method : > > function ajax_update($id,$sub) > { > $value = $this->params['form']['value']; //new value > to save > > $this->Utilisateur->id = $id; > if (!$this->Utilisateur->saveField($sub, $value, > true)) > { > $this->set('error', true); > } > $user = $this->Utilisateur->read(array($sub), $id); > $this->set('value',$user['Utilisateur'][$sub]); > $this->layout = 'ajax'; > } > > and finally th ajax_update.thtml > > > If anybody has an idea... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ajax editor and view
Hi, I've put an ajax editor in my view and the problem I have is when I edit my field for the second or more time, the value in the text field is prefixed with sereval tabulation (I don't see directly the value in the input). I don't understand where they come from. this is a piece of my view : editor('ajax_edit_nom','/utilisateurs/ajax_update/'. $user['utilisateurid'].'/nom')); ?> and my UtilisateursController with the ajax_update() method : function ajax_update($id,$sub) { $value = $this->params['form']['value']; //new value to save $this->Utilisateur->id = $id; if (!$this->Utilisateur->saveField($sub, $value, true)) { $this->set('error', true); } $user = $this->Utilisateur->read(array($sub), $id); $this->set('value',$user['Utilisateur'][$sub]); $this->layout = 'ajax'; } and finally th ajax_update.thtml If anybody has an idea... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax->editor error message
Ok, I have readed it, but I still don't understand it... I have just started and I'm not very good in it. with this code: $this->Model->saveField('fiedl', value, true) cake checks the correct format of the new value, if the format is wrong it doesn't save the new data, and in a normal view (without ajax) this message error is displayed with this code: $html->tagErrorMsg('Model/field', 'Error message.') Now How I can do that with $ajax->editor? In the ajax view I have this: tagErrorMsg('Model/field', 'Error message for email goes here.') ?> But the tagErrorMsg doesn't run. Thanks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax->editor error message
Have u tried this? $this->ClassName->invalidate('fieldname'); That should cause the errorMessage tag to show up. Michael On Nov 28, 5:18 pm, "carlosrg" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using ajax->editor to update some fields of a table. > > How can I send an error message, for example when the field has a wrong > format? > > Thanks a lot! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax->editor error message
http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ajax->editor error message
Hi, I'm using ajax->editor to update some fields of a table. How can I send an error message, for example when the field has a wrong format? Thanks a lot! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax->editor
Hi carlosrg, Great...got it working in one shot... But now I am thinking what happens if I have more than one field that can be updated via ajax. For instance there is email, date of birth, etc Will I need to create separate controller methods and view for each of them or there is some trick to do this. Thanks for your help Regards --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ajax->editor
let's see if this works for you: In the view: Email: editor('ajax_edit_email', '/posts/ajax_update_email/' . $serial_number['Post']['id']) ?> 'ajax_edit_email' -> id to update '/posts/ajax_update_email/' . $serial_number['Post']['id'] -> url that calls the action within the action: function ajax_update_email($id) { $email = $this->params['form']['value']; //new value to save $this->SerialNumber->id = $id; if (!$this->SerialNumber->saveField('email', $email, true)) { $this->set('error', true); } $this->set('serial_number', $this->Post->read(null, $id)); $this->layout = 'ajax'; } In the ajax view (ajax_update_email.thtml) echo $post['Post']['email'] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ajax->editor
Hi, Does anyone has a pointer to ajax->editor tutorial. I searched group, cakephp website, irc, bakery and, finally, google, but nothing. There is ajax tutorial on tada list. But its way to complicated for my purpose. Please let me know if you any page that explains how to implement ajax->editor. Regards, --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to use "ajax->editor"
I am not able to understand it properly. Could anybody plz help. Thanks in advance :) cheers suman --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---