Re: ajax multiple div update
It wasn't a question of version number. The div had to be present in the old and in the new page. I was trying to update the div "first" in my pages/home.ctp with controller/test.ctp It didn't work until I add div "first" definition to my controller/test.ctp Hope it helps someone On Nov 16, 2007 12:31 PM, Luigi <[EMAIL PROTECTED]> wrote: > I use Cake 1.2.0.5875 pre-beta > and prototype 1.5.0_rc0 > > Now I know it works fine for oders, I should try new prototype version. > > Wich One should I use with cake ? 1.6 ? 1.5.2 ??? > > > On Nov 16, 2007 5:47 AM, Dennis Nikiforov <[EMAIL PROTECTED]> > wrote: > > > What version of prototype do you have and what version of cake? Cake is > > being changed very quickly, so a more exact version would help. > > > > > > francky06l wrote: > > > > I do update multiple div's with cake 1.2 without any problem. > > I will try nate's code again > > > > On Nov 15, 5:13 pm, schneimi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > > > > Well, I don't think it is possible without some changes (e.g. my > > hack), but I wondered about some examples like in the first post I > > also found, maybe it was supported formerly? But in the end cakePHP > > just builds upon the prototype framework and I couldn't find any > > support for that sort of update there as well. > > > > Michael > > > > On 15 Nov., 12:10, Luigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > > > > > > no one else ? > > > > > > On Nov 14, 2007 8:38 AM, Dennis Nikiforov <[EMAIL PROTECTED]> <[EMAIL > > PROTECTED]> > > wrote: > > > > > >But is there a way without modifying cake? The development is progressing > > quite quickly, so I like to keep up to date and updating a modified version > > is suiside. > > > > > > Dennis > > > > > > schneimi wrote: > > > > > > I needed this too but for a remoteTimer, but the code like yours > > didn't work and I also didn't find any support for that intention > > inside the cakePHP code. > > > > > > Because of that, I decided to hack a little bit into the code to get > > this working, it may not be the best idea to do that, but it helped me > > to get my stuff working, so maybe that could help you too. You can > > read my changes on my blog, but not sure how that fits for $ajax- > > > > > > > > link:http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-... > > > > > >Michael > > > > > > On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL > > PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > > > >I try this old (nate's) code : > > > > > > // test.thtml > > > > link('Update 2 Div\'s', '/controller/test', array('update' > > => > > array('first', 'second'))); ?> > > > > > > div('first'); ?> > > This is the first div, it has the current time: > > > > divEnd('first'); ?> > > > > > > div('second'); ?> > > This is the second div, it shows server variables: > > > > divEnd('second'); ?> > > > > > > > > but it doesn't seem to work anymore. > > > > > > Wath's the new way ? > > > > > > -- > > Luigi > > > > > > > > > > > > > > > > > -- > Luigi -- Luigi --~--~-~--~~~---~--~~ 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 multiple div update
I use Cake 1.2.0.5875 pre-beta and prototype 1.5.0_rc0 Now I know it works fine for oders, I should try new prototype version. Wich One should I use with cake ? 1.6 ? 1.5.2 ??? On Nov 16, 2007 5:47 AM, Dennis Nikiforov <[EMAIL PROTECTED]> wrote: > What version of prototype do you have and what version of cake? Cake is > being changed very quickly, so a more exact version would help. > > > francky06l wrote: > > I do update multiple div's with cake 1.2 without any problem. > I will try nate's code again > > On Nov 15, 5:13 pm, schneimi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > Well, I don't think it is possible without some changes (e.g. my > hack), but I wondered about some examples like in the first post I > also found, maybe it was supported formerly? But in the end cakePHP > just builds upon the prototype framework and I couldn't find any > support for that sort of update there as well. > > Michael > > On 15 Nov., 12:10, Luigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > > no one else ? > > > On Nov 14, 2007 8:38 AM, Dennis Nikiforov <[EMAIL PROTECTED]> <[EMAIL > PROTECTED]> > wrote: > > >But is there a way without modifying cake? The development is progressing > quite quickly, so I like to keep up to date and updating a modified version > is suiside. > > > Dennis > > > schneimi wrote: > > > I needed this too but for a remoteTimer, but the code like yours > didn't work and I also didn't find any support for that intention > inside the cakePHP code. > > > Because of that, I decided to hack a little bit into the code to get > this working, it may not be the best idea to do that, but it helped me > to get my stuff working, so maybe that could help you too. You can > read my changes on my blog, but not sure how that fits for $ajax- > > > > link:http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-... > > >Michael > > > On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL > PROTECTED]> <[EMAIL PROTECTED]> wrote: > > >I try this old (nate's) code : > > > // test.thtml > > link('Update 2 Div\'s', '/controller/test', array('update' > => > array('first', 'second'))); ?> > > > div('first'); ?> > This is the first div, it has the current time: > > divEnd('first'); ?> > > > div('second'); ?> > This is the second div, it shows server variables: > > divEnd('second'); ?> > > > > but it doesn't seem to work anymore. > > > Wath's the new way ? > > > -- > Luigi > > > > > > > -- Luigi --~--~-~--~~~---~--~~ 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 multiple div update
What version of prototype do you have and what version of cake? Cake is being changed very quickly, so a more exact version would help. francky06l wrote: I do update multiple div's with cake 1.2 without any problem. I will try nate's code again On Nov 15, 5:13 pm, schneimi <[EMAIL PROTECTED]> wrote: Well, I don't think it is possible without some changes (e.g. my hack), but I wondered about some examples like in the first post I also found, maybe it was supported formerly? But in the end cakePHP just builds upon the prototype framework and I couldn't find any support for that sort of update there as well. Michael On 15 Nov., 12:10, Luigi <[EMAIL PROTECTED]> wrote: no one else ? On Nov 14, 2007 8:38 AM, Dennis Nikiforov <[EMAIL PROTECTED]> wrote: But is there a way without modifying cake? The development is progressing quite quickly, so I like to keep up to date and updating a modified version is suiside. Dennis schneimi wrote: I needed this too but for a remoteTimer, but the code like yours didn't work and I also didn't find any support for that intention inside the cakePHP code. Because of that, I decided to hack a little bit into the code to get this working, it may not be the best idea to do that, but it helped me to get my stuff working, so maybe that could help you too. You can read my changes on my blog, but not sure how that fits for $ajax- link:http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-... Michael On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: I try this old (nate's) code : // test.thtml link('Update 2 Div\'s', '/controller/test', array('update' => array('first', 'second'))); ?> div('first'); ?> This is the first div, it has the current time: divEnd('first'); ?> div('second'); ?> This is the second div, it shows server variables: divEnd('second'); ?> but it doesn't seem to work anymore. Wath's the new way ? -- Luigi --~--~-~--~~~---~--~~ 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 multiple div update
I do update multiple div's with cake 1.2 without any problem. I will try nate's code again On Nov 15, 5:13 pm, schneimi <[EMAIL PROTECTED]> wrote: > Well, I don't think it is possible without some changes (e.g. my > hack), but I wondered about some examples like in the first post I > also found, maybe it was supported formerly? But in the end cakePHP > just builds upon the prototype framework and I couldn't find any > support for that sort of update there as well. > > Michael > > On 15 Nov., 12:10, Luigi <[EMAIL PROTECTED]> wrote: > > > no one else ? > > > On Nov 14, 2007 8:38 AM, Dennis Nikiforov <[EMAIL PROTECTED]> > > wrote: > > > > But is there a way without modifying cake? The development is progressing > > > quite quickly, so I like to keep up to date and updating a modified > > > version > > > is suiside. > > > > Dennis > > > > schneimi wrote: > > > > I needed this too but for a remoteTimer, but the code like yours > > > didn't work and I also didn't find any support for that intention > > > inside the cakePHP code. > > > > Because of that, I decided to hack a little bit into the code to get > > > this working, it may not be the best idea to do that, but it helped me > > > to get my stuff working, so maybe that could help you too. You can > > > read my changes on my blog, but not sure how that fits for $ajax- > > > > > > > link:http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-... > > > > Michael > > > > On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > > I try this old (nate's) code : > > > > // test.thtml > > > > > > link('Update 2 Div\'s', '/controller/test', array('update' > > > => > > > array('first', 'second'))); ?> > > > > div('first'); ?> > > > This is the first div, it has the current time: > > > > > > divEnd('first'); ?> > > > > div('second'); ?> > > > This is the second div, it shows server variables: > > > > > > divEnd('second'); ?> > > > > > > > but it doesn't seem to work anymore. > > > > Wath's the new way ? > > > -- > > Luigi --~--~-~--~~~---~--~~ 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 multiple div update
Well, I don't think it is possible without some changes (e.g. my hack), but I wondered about some examples like in the first post I also found, maybe it was supported formerly? But in the end cakePHP just builds upon the prototype framework and I couldn't find any support for that sort of update there as well. Michael On 15 Nov., 12:10, Luigi <[EMAIL PROTECTED]> wrote: > no one else ? > > On Nov 14, 2007 8:38 AM, Dennis Nikiforov <[EMAIL PROTECTED]> > wrote: > > > > > But is there a way without modifying cake? The development is progressing > > quite quickly, so I like to keep up to date and updating a modified version > > is suiside. > > > Dennis > > > schneimi wrote: > > > I needed this too but for a remoteTimer, but the code like yours > > didn't work and I also didn't find any support for that intention > > inside the cakePHP code. > > > Because of that, I decided to hack a little bit into the code to get > > this working, it may not be the best idea to do that, but it helped me > > to get my stuff working, so maybe that could help you too. You can > > read my changes on my blog, but not sure how that fits for $ajax- > > > > > link:http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-... > > > Michael > > > On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > I try this old (nate's) code : > > > // test.thtml > > > > link('Update 2 Div\'s', '/controller/test', array('update' > > => > > array('first', 'second'))); ?> > > > div('first'); ?> > > This is the first div, it has the current time: > > > > divEnd('first'); ?> > > > div('second'); ?> > > This is the second div, it shows server variables: > > > > divEnd('second'); ?> > > > > > but it doesn't seem to work anymore. > > > Wath's the new way ? > > -- > Luigi --~--~-~--~~~---~--~~ 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 multiple div update
no one else ? On Nov 14, 2007 8:38 AM, Dennis Nikiforov <[EMAIL PROTECTED]> wrote: > But is there a way without modifying cake? The development is progressing > quite quickly, so I like to keep up to date and updating a modified version > is suiside. > > Dennis > > > schneimi wrote: > > I needed this too but for a remoteTimer, but the code like yours > didn't work and I also didn't find any support for that intention > inside the cakePHP code. > > Because of that, I decided to hack a little bit into the code to get > this working, it may not be the best idea to do that, but it helped me > to get my stuff working, so maybe that could help you too. You can > read my changes on my blog, but not sure how that fits for $ajax- > > > link: > http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-one-ajax-request-response/ > > Michael > > On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > > I try this old (nate's) code : > > // test.thtml > > link('Update 2 Div\'s', '/controller/test', array('update' > => > array('first', 'second'))); ?> > > div('first'); ?> > This is the first div, it has the current time: > > divEnd('first'); ?> > > div('second'); ?> > This is the second div, it shows server variables: > > divEnd('second'); ?> > > > but it doesn't seem to work anymore. > > Wath's the new way ? > > > > > > > -- Luigi --~--~-~--~~~---~--~~ 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 multiple div update
But is there a way without modifying cake? The development is progressing quite quickly, so I like to keep up to date and updating a modified version is suiside. Dennis schneimi wrote: I needed this too but for a remoteTimer, but the code like yours didn't work and I also didn't find any support for that intention inside the cakePHP code. Because of that, I decided to hack a little bit into the code to get this working, it may not be the best idea to do that, but it helped me to get my stuff working, so maybe that could help you too. You can read my changes on my blog, but not sure how that fits for $ajax- link: http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-one-ajax-request-response/ Michael On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> wrote: I try this old (nate's) code : // test.thtml link('Update 2 Div\'s', '/controller/test', array('update' => array('first', 'second'))); ?> div('first'); ?> This is the first div, it has the current time: divEnd('first'); ?> div('second'); ?> This is the second div, it shows server variables: divEnd('second'); ?> but it doesn't seem to work anymore. Wath's the new way ? --~--~-~--~~~---~--~~ 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 multiple div update
I needed this too but for a remoteTimer, but the code like yours didn't work and I also didn't find any support for that intention inside the cakePHP code. Because of that, I decided to hack a little bit into the code to get this working, it may not be the best idea to do that, but it helped me to get my stuff working, so maybe that could help you too. You can read my changes on my blog, but not sure how that fits for $ajax- >link: >http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-one-ajax-request-response/ Michael On 13 Nov., 22:58, wluigi <[EMAIL PROTECTED]> wrote: > I try this old (nate's) code : > > // test.thtml > > link('Update 2 Div\'s', '/controller/test', array('update' > => > array('first', 'second'))); ?> > > div('first'); ?> > This is the first div, it has the current time: > > divEnd('first'); ?> > > div('second'); ?> > This is the second div, it shows server variables: > > divEnd('second'); ?> > > > but it doesn't seem to work anymore. > > Wath's the new way ? --~--~-~--~~~---~--~~ 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 multiple div update
I try this old (nate's) code : // test.thtml link('Update 2 Div\'s', '/controller/test', array('update' => array('first', 'second'))); ?> div('first'); ?> This is the first div, it has the current time: divEnd('first'); ?> div('second'); ?> This is the second div, it shows server variables: divEnd('second'); ?> but it doesn't seem to work anymore. Wath's the new way ? --~--~-~--~~~---~--~~ 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 multiple div update using render in controller
Thanks fpr help, I figured out that I mistype one of the link ..(I did check it 100 times, but maybe too long looking at this code). Anyway after cleaning the cahe, it works ... Now I have another question : on a simple "view" for I want to put a button to go back to the previous page ..So I can make a submit with some javascript ...but I am very "light" in Java, I have some scriptaclous lib and others stuff, but maybe you have a quicker way to do this ? Of course I could set en empty form on the view, handle it in controller that would redirect to the referrer..but maybe there is a shorcut ? Thanks again for you help --~--~-~--~~~---~--~~ 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 multiple div update using render in controller
Short checklist: (1) Have you checked your paths? The "/controller/test" URL in the example code was just a fill-in-the-blank. (2) Have you checked your JavaScript console to see if you are getting any errors there? (3) Do you have the Prototype library loaded properly? (4) Paste your code: http://cakephp.org/pastes/add You can paste your controller and view code at the link above, which can help us figure out whether or not you're doing something wrong. --~--~-~--~~~---~--~~ 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 multiple div update using render in controller
Thanks a lot, I have tested the given example and it does not work on my side ... When I press the link, the div are not updated (neither time or variable).. I must have got something wrong, into some "tricky" variable ? layout ? controllers ?? But I have other part of Ajax working (the one updating 1 div and rendering view in view).. Thanks anyway --~--~-~--~~~---~--~~ 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 multiple div update using render in controller
I think you're over-thinking this, it's really quite simple. In your example, you just need to make the following change: // test.thtml div("main_head")); ?> Main Head Updated divEnd("main_head")); ?> div("sub_head")); ?> Sub head updated divEnd("sub_head")); ?> No requestAction( ) required, and your link above can include GET parameters just like any other link. --~--~-~--~~~---~--~~ 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 multiple div update using render in controller
Thanks, So basically what I am trying to do is not achievable this way. In my view I could enclose the Main / SubHeader with $ajax->div / endDiv, and place a requestAction in beetween ? This action would then render the view ? As shown in the acticle that I know, the code between the div is actually php code. The action to update the div's make the code executing again ? Thanks for you help, I wounder how I will make this using a requestAction since I need parameters on this action .. --~--~-~--~~~---~--~~ 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 multiple div update using render in controller
Using AjaxHelper::div( ) and AjaxHelper::divEnd( ), you can create sections of your view that can be rendered and updated on the client side. And although you could update one view with the contents of another, the whole point of this feature is to allow you to use a single view/action for regular web requests, as well as Ajax and Ajax update requests. See here for a code example: http://groups.google.com/group/cake-php/msg/cf10b929a33db24e --~--~-~--~~~---~--~~ 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 multiple div update using render in controller
Hi All, I am playing with Ajax in Cake more and more and I like it. I just upgraded the Cake version and found out that we can update multiple Div in a single ajax call. I have seen here some topics about this, but none answer to my question : can we update multiple div in a controller action by returning a "view" ? for example : index.thtml Main Head Sub head link('test', '/app/test/, array('update' => array('main_head', 'sub_head')); ?> now in the controller function test() { render('test', 'ajax'); } in the test.thtml Main Head Updated http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---