Re: repeatedly call controller action through ajax

2010-03-24 Thread alex bailey
´I think I've got it to work by doing as you said with a few
compromises here and there : )
Big thanks I really appreciate your help.

Regards

Alex

On 24 Mrz., 11:29, John Andersen  wrote:
> Ok, if your page is loading normaly, then pass the information to the
> view/layout and in there, make the decision to activate or not, the
> ajax request to the bar action.
> How you are going to do it is up to you, I have no idea :) of what
> information you use and how you have chosen to implement your solution
> to your web site!
> Enjoy,
>    John
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: repeatedly call controller action through ajax

2010-03-24 Thread John Andersen
Ok, if your page is loading normaly, then pass the information to the
view/layout and in there, make the decision to activate or not, the
ajax request to the bar action.
How you are going to do it is up to you, I have no idea :) of what
information you use and how you have chosen to implement your solution
to your web site!
Enjoy,
   John

On Mar 24, 11:32 am, alex bailey  wrote:
> Hi John,
>
> thanks for your answer could you explain a bit further how to retrieve
> the condition and return it with the result? I've worked with php a
> long time now but i just recently delved into ajax so I still have to
> find my way around. And btw my normal page loading works without ajax
> I only want a action which reacts to specified events (like a change
> in the database) to be executed over and over again and "do something"
> if that certain event happens.
>
> Regards
>
> Alex
>
> On 24 Mrz., 08:09, John Andersen  wrote:
>
> > I am not sure how your page loading is working - with ajax or without
> > - so here is what I would do based on your information:
>
> > In the first ajax call to the bar action, retrieve the dynamic
> > condition and return it together with the ajax result. Then act upon
> > it as you want.
>
> > Enjoy,
> >    John

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: repeatedly call controller action through ajax

2010-03-24 Thread alex bailey
Hi John,

thanks for your answer could you explain a bit further how to retrieve
the condition and return it with the result? I've worked with php a
long time now but i just recently delved into ajax so I still have to
find my way around. And btw my normal page loading works without ajax
I only want a action which reacts to specified events (like a change
in the database) to be executed over and over again and "do something"
if that certain event happens.

Regards

Alex

On 24 Mrz., 08:09, John Andersen  wrote:
> I am not sure how your page loading is working - with ajax or without
> - so here is what I would do based on your information:
>
> In the first ajax call to the bar action, retrieve the dynamic
> condition and return it together with the ajax result. Then act upon
> it as you want.
>
> Enjoy,
>    John
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: repeatedly call controller action through ajax

2010-03-24 Thread John Andersen
I am not sure how your page loading is working - with ajax or without
- so here is what I would do based on your information:

In the first ajax call to the bar action, retrieve the dynamic
condition and return it together with the ajax result. Then act upon
it as you want.

Enjoy,
   John

On Mar 24, 1:22 am, alex bailey  wrote:
> Hi guys,
>
> I'm having a problem with my project where I could freak out about.
> The situation is the following:
>
> I have a controller foo which has an action bar.
>
> Now the thing i want to get going: have the bar action running all the
> time while your on the page by a fixed interval with a condition if a
> certain entry is made in the database.
>
> I got it to work by using ajax and the remoteTimer method. But now I
> have the following problem:
>
> I can't figure out how I can have a "dynamic condition"  like: Only
> run the ajax event if a certain field in database is set to 0 or 1
>
> I know I can control the execution by the condition param and using a
> javascript If() (Like: 'condition' => '10 == 90' which will prevent it
> from running) in there but is it possible to populate this condition
> dynamically from the database or is there even a better way to handle
> this whole situation?
>
> Big thanks in advance.
>
> Regards
>
> Alex

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


repeatedly call controller action through ajax

2010-03-23 Thread alex bailey
Hi guys,

I'm having a problem with my project where I could freak out about.
The situation is the following:

I have a controller foo which has an action bar.

Now the thing i want to get going: have the bar action running all the
time while your on the page by a fixed interval with a condition if a
certain entry is made in the database.

I got it to work by using ajax and the remoteTimer method. But now I
have the following problem:

I can't figure out how I can have a "dynamic condition"  like: Only
run the ajax event if a certain field in database is set to 0 or 1

I know I can control the execution by the condition param and using a
javascript If() (Like: 'condition' => '10 == 90' which will prevent it
from running) in there but is it possible to populate this condition
dynamically from the database or is there even a better way to handle
this whole situation?

Big thanks in advance.

Regards

Alex

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.