Re: How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-15 Thread heavyKevy
Okay, problem solved. The _ext is not needed, removed it. added the line: $this->RequestHandler->renderAs($this, 'json'); Now renders as a JsonView and the _Serialize is automatically detected and no template file required. Regards, --Kevin On Wednesday, October 14, 2015 at 2:02:24 PM U

Re: How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-14 Thread heavyKevy
I discovered a bug in the Route.php file. the reg expression used for finding extensions only works if no parameters are passed in the URL. I have temporarily modified my Routes.php file to find the extension anywhere in the string and used str_replace to remove the .json from the url and I no l

Re: How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-14 Thread Kevin Arnett
code that generated the URL: $url = $this->Url->build(['controller' => 'Purchases', 'action' => 'get_sales_people_select_list','_ext'=>'json']); $url = $url . '/47'; The generated URL: /purchases/get-sales-people-select-list.json/47 Is this not correct? On Wed, Oct 14, 2015 at 4:40 PM, Anthony G

Re: How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-14 Thread Anthony GRASSIOT
Did you correctly specify the data type json in your ajax call ? Le 14 oct. 2015 09:02, "heavyKevy" a écrit : > I have gone through the documentation, which is a bit too vague, and tried > many things, but I still am getting an error that the template file is > missing. > > I had this working sen

How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-14 Thread heavyKevy
I have gone through the documentation, which is a bit too vague, and tried many things, but I still am getting an error that the template file is missing. I had this working sending back a json response in 3.0 using ext='json', yet after updating to 3.1 it is broken. I checked the migration

Re: Authentication and multiple ajax request

2015-01-17 Thread euromark
Well, what you are doing there is pretty wrong in the first place. Calling login($data) directly logs in whatever you send it (see the docs for details), rendering a form login process invalid and insecure. You should, just as with any other non-ajax request, properly use the Auth adapters to

Authentication and multiple ajax request

2015-01-17 Thread Ryan de Haast
Hi All I recently discovered that cake authentication class does not like multiple ajax requests. While recently testing my app, I found it would return a 403 error the moment I do multiple ajax requests on a logged in user. I managed to narrow it down to the following code: $auth = $this->S

Re: Ajax request

2013-09-25 Thread Gaurav Matta
For better solution do not refresh the button but only the search result. On 25-Sep-2013 6:47 PM, wrote: > Hello, > I have a problem with a search field on my site and I hope you can help > me. I got a table called "Clients" with some information like firstname, > lastname, adress etc. and all MV

Re: Ajax request

2013-09-25 Thread Gaurav Matta
You will need to rewrite the autocomplete code on page you are requesting on the fly for search. If I am correct your search is also Ajax based... On 25-Sep-2013 6:47 PM, wrote: > Hello, > I have a problem with a search field on my site and I hope you can help > me. I got a table called "Clients"

Ajax Request

2013-09-25 Thread webgaertner
Hello, I have a problem with a search field on my site and I hope you can help me. I got a table called "Clients" with some information like firstname, lastname, adress etc. and all MVC files. For testing I use the Client index function. In my index view file I have a input field where I want to

Ajax request

2013-09-25 Thread webgaertner
Hello, I have a problem with a search field on my site and I hope you can help me. I got a table called "Clients" with some information like firstname, lastname, adress etc. and all MVC files. For testing I use the Client index function. In my view file I have a input field where I want to searc

Ajax Request resulting in exponential requests.

2013-05-01 Thread Anthony France
So, I've got the following bit of code: start('search'); ?> Js->get('#ItemIndexForm')->serializeForm(array('isForm' => true, 'inline' => true)); $this->Js->get('#ItemIndexForm #ItemName')->event('keyup',$this->Js->request(array('action' => 'index'), array('update' => '#content', 'data' => $data

Re: Is there any way to display error when working on ajax request?

2013-05-01 Thread Anthony
use debug and tail the debug.log file. On Wednesday, February 9, 2011 12:43:42 PM UTC-6, cake-learner wrote: > > I set up one class to handle all ajax request called ajax_controll. > The thing is everytime I develop a function and there is some kind of > syntactic errors it r

CakePHP and Ajax request

2013-03-20 Thread Piotr Chabros
Hi I am currently using ajax in multiple controllers in my application. I implemented the ajax functionality using the jQuery supported version. $.ajax({ url:'getCountries', type: "POST", dataType: "html", data:"data=" + result, success: function(data){ //magic... } } });

RE: Render Element with AJAX Request / Response

2012-10-19 Thread Advantage+
Is 1 more efficient over the other? Thanks, Dave From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of majna Sent: Friday, October 19, 2012 8:46 AM To: cake-php@googlegroups.com Subject: Re: Render Element with AJAX Request / Response Hi, Controller::render() re

Re: Render Element with AJAX Request / Response

2012-10-19 Thread majna
Hi, Controller::render() returns CakeResponse object, so try 'html' => $this->render()->body() On Friday, October 19, 2012 2:56:44 AM UTC+2, advantage+ wrote: > > My original function to return a JSON array no longer works with v2.1.3 > > > > This worked in 1.3: loaded a form into a modal win

Re: Render Element with AJAX Request / Response

2012-10-18 Thread Vanja Dizdarević
> $this->_ajaxReturn( $response ); //simply encodes and returns the > $response echo json_encode($response); > Returns to what? Your best bet is to use a JSON view: http://book.cakephp.org/2.0/en/views/json-and-xml-views.html -- Like Us on FaceBook h

Render Element with AJAX Request / Response

2012-10-18 Thread Advantage+
My original function to return a JSON array no longer works with v2.1.3 This worked in 1.3: loaded a form into a modal window Controller code snip: if ( empty( $this->data ) ) { $this->data = $record; //debug shows the $record so there is data / debug is at 0 now

Chosen doesn't work after ajax request

2012-07-19 Thread mebibyte
Hey I'm using chosen for a dynamic multiselect, see link<http://harvesthq.github.com/chosen/> . I works perfectly but when I put it in a view which a call with ajax the javascript doesn't work anymore. So how can I run a javascript after a ajax request. the view with th

Problem with empty Ajax-Request-Response

2011-12-29 Thread Gerrit
Hello everybody, I've a problem with my JQuery Mobile Application. When I open my Web Root I become redirected by Auth Component to my Login-Action. When I try to request the same webroot via Ajax the response is empty. Jquery mobile therefore writes Undifined as result in my browser window. Has a

Re: debug level on ajax request

2011-08-27 Thread p r
further reading http://cakephp.lighthouseapp.com/projects/42648/tickets/1941-changing-debug-level-on-runtime -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP r

Re: debug level on ajax request

2011-08-26 Thread p r
thanks this is a good point. i think it is a problem in generally, not only on ajax requests... if (isset($config['debug']) || isset($config['log'])) { $reporting = 0; if ($_this->debug) { this lines from configure config['debug'] is

Re: debug level on ajax request

2011-08-25 Thread stas kim
oops. it's not on boot strap only. my bad. On Thu, Aug 25, 2011 at 12:47 PM, stas kim wrote: > it's probably because of this line > https://github.com/cakephp/cakephp/blob/master/cake/libs/configure.php#L119 > which is executed on bootstrap. meaning even if you change debug level > later in your

Re: debug level on ajax request

2011-08-25 Thread stas kim
it's probably because of this line https://github.com/cakephp/cakephp/blob/master/cake/libs/configure.php#L119 which is executed on bootstrap. meaning even if you change debug level later in your controller it will only effect Debugger class behavior cheers On Wed, Aug 24, 2011 at 11:21 AM, Ben

Re: debug level on ajax request

2011-08-24 Thread Ben McClure
Fixing warnings and notices is not the answer to his question--With debug mode off, he should not be getting such messages displayed. At worse, he should be seeing formatted Cake errors or simply a blank page if something is wrong. Perhaps the warnings/notices/errors are being thrown before you

Re: debug level on ajax request

2011-08-24 Thread p r
yes you're right. but the debug mode is for developing purposes and my question belongs to control the debug mode in app controller. On 22 Aug., 10:28, "Dr. Loboto" wrote: > The best way is to fix that warnings and notices. Good app never > throws this kind of shit. > > On 18 авг, 20:18, p r

Re: debug level on ajax request

2011-08-22 Thread Dr. Loboto
The best way is to fix that warnings and notices. Good app never throws this kind of shit. On 18 авг, 20:18, p r wrote: > yes the Requesthandler is in use and the debug level is set correctly > to 0 but errors and notices doesn't care. > It seems the backtrace is added before the debug level is s

Re: debug level on ajax request

2011-08-18 Thread p r
yes the Requesthandler is in use and the debug level is set correctly to 0 but errors and notices doesn't care. It seems the backtrace is added before the debug level is set in AppController? When i set the debug level in core.php it works as i desired. On 18 Aug., 15:06, mi...@brightstorm.co.uk

Re: debug level on ajax request

2011-08-18 Thread mikek
> Hello, > > could anybody explain this behavior? i set in my app controller > > if($this->RequestHandler->isAjax()) { > $this->layout = 'ajax'; > $this->autoRender = false; > Configure::write('debug', 0); > } > > but notices and err

Re: debug level on ajax request

2011-08-18 Thread mikek
> Hello, > > could anybody explain this behavior? i set in my app controller > > if($this->RequestHandler->isAjax()) { > $this->layout = 'ajax'; > $this->autoRender = false; > Configure::write('debug', 0); > } > > but notices and err

debug level on ajax request

2011-08-18 Thread p r
Hello, could anybody explain this behavior? i set in my app controller if($this->RequestHandler->isAjax()) { $this->layout = 'ajax'; $this->autoRender = false; Configure::write('debug', 0); } but notices and errors are even

Detect session timeout with on AJAX request with javascript

2011-06-23 Thread Gonçalo
Hi there. I've been looking for a way to detect on the client side that the ajax request he performed was not successful because the user session has expired. My problem is not related with security level (seen too many people with this one..). I've red this blog pos

Re: Ajax request sends 2 times

2011-03-14 Thread Jens Dittrich
Why are you mixing the (deprecated) Ajax-Helper with html code for a form? Have you tried relying on the helper to produce the code for your form? On 14 Mrz., 14:21, heohni wrote: > Hi, > > I have this form: > Ajax->Form('searchMember', 'post', array('update' => > 'target', 'url' => array('action

Re: Ajax request sends 2 times

2011-03-14 Thread cricket
On Mon, Mar 14, 2011 at 9:21 AM, heohni wrote: > Hi, > > I have this form: > Ajax->Form('searchMember', 'post', array('update' => > 'target', 'url' => array('action' => 'searchMember'))); ?> > > Suchwort: > > > > > Ajax->Form->end(); ?> > > And everytime I press the submit button, the request

Ajax request sends 2 times

2011-03-14 Thread heohni
Hi, I have this form: Ajax->Form('searchMember', 'post', array('update' => 'target', 'url' => array('action' => 'searchMember'))); ?> Suchwort: Ajax->Form->end(); ?> And everytime I press the submit button, the request is send 2 times, I can see this with firebug in my firefox. Is there some

Re: Is there any way to display error when working on ajax request?

2011-02-10 Thread Sam Sherlock
9, 2011 3:17 PM > To: CakePHP > Subject: Re: Is there any way to display error when working on ajax > request? > > Since your method of request for the action is ajax, I'm assuming it's > publicly accessible. > > So the best way to dev it is thru the browser then apply

RE: Is there any way to display error when working on ajax request?

2011-02-09 Thread Krissy Masters
hn818 Sent: Wednesday, February 09, 2011 3:17 PM To: CakePHP Subject: Re: Is there any way to display error when working on ajax request? Since your method of request for the action is ajax, I'm assuming it's publicly accessible. So the best way to dev it is thru the browser then apply your aj

Re: Is there any way to display error when working on ajax request?

2011-02-09 Thread ibejohn818
e: > I set up one class to handle all ajax request called ajax_controll. > The thing is everytime I develop a function and there is some kind of > syntactic errors it returns empty. Usually take a couple of hours to > develop > one simple query because of this. Is it anyway to sp

Is there any way to display error when working on ajax request?

2011-02-09 Thread cake-learner
I set up one class to handle all ajax request called ajax_controll. The thing is everytime I develop a function and there is some kind of syntactic errors it returns empty. Usually take a couple of hours to develop one simple query because of this. Is it anyway to spit out the php error on browser

Odd RequestHandler->isAjax evaluation during ajax request in webkit browsers

2011-01-29 Thread BARTCC
Hi, yesterday I noticed some odd behavior of my web app while testing it in Safari: Here is the line of code in my controller where it all the weirdness happens: if (!$this->RequestHandler->isAjax()) { $this->Session->write('Auth.User.activeRecordId', NO_ID); $this->Session

starting ajax request from php

2010-08-31 Thread Tomfox Wiranata
hi, usually i do this to implement ajax feeling: VIEW: with jquery I call the controller functions and tell cake where (in a DIV) to write the result $('#attachments_count').load('countattachments'); CONTROLLER then all the logic happens in my controller function, countattachments, and I tell

Re: Action, called by an Ajax request, running twice.

2010-05-24 Thread WebbedIT
I had weird problems with ajax calls happening twice (when deleting a record in a modalbox). I'm pretty certain it came down to using FireBug for me which sometimes, but not all the time, reloads the request to get some extra information. Paul. Check out the new CakePHP Questions site http://cak

Re: Action, called by an Ajax request, running twice.

2010-05-23 Thread John Andersen
Check that you are returning false to the form itself, when you submit the form with ajax, as else the form will think that it must also submit! Does this apply to your case? Enjoy, John On May 22, 7:00 pm, Felipe Carballo wrote: > Hello guys! I'm having a problem using jQuery UI and Ajax Help

Action, called by an Ajax request, running twice.

2010-05-22 Thread Felipe Carballo
Hello guys! I'm having a problem using jQuery UI and Ajax Helper, with Prototype. My form is opened in a dialog box using jQuery UI. When I send the form, my action is executed twice. If I remove the library jQuery UI, the action is performed correctly (once). Does anyone know how I can fix this pr

Re: Adding postdata to a ajax request in before callback.

2010-03-22 Thread Dr. Loboto
ith" option you can add any JS code that should return well- > > formed "name1=value1&name2=value2" string. Value of this option is not > > escaped by Cake. > > > On Mar 22, 8:39 pm, Karsten Backhaus wrote: > > > > I wonder if it is possible to add pos

Re: Adding postdata to a ajax request in before callback.

2010-03-22 Thread Karsten Backhaus
ption is not > escaped by Cake. > > On Mar 22, 8:39 pm, Karsten Backhaus wrote: > > > I wonder if it is possible to add postdata to the ajax request before > > it is send to the server. Currently I simply add hidden form-fields to > > the formular which is supposed t

Re: Adding postdata to a ajax request in before callback.

2010-03-22 Thread Dr. Loboto
In "with" option you can add any JS code that should return well- formed "name1=value1&name2=value2" string. Value of this option is not escaped by Cake. On Mar 22, 8:39 pm, Karsten Backhaus wrote: > I wonder if it is possible to add postdata to the ajax request before

Adding postdata to a ajax request in before callback.

2010-03-22 Thread Karsten Backhaus
I wonder if it is possible to add postdata to the ajax request before it is send to the server. Currently I simply add hidden form-fields to the formular which is supposed to be sent to the server though that's pretty slow as the browser has to rebuild the dom everytime I add something to the

Re: ajax request using default.ctp instead of ajax.ctp

2010-02-11 Thread Dr. Loboto
Simple include of RequestHandler component will do all automagically. On Feb 12, 9:17 am, NickPick wrote: > thanks. that worked. > > On Feb 11, 7:38 pm, John Andersen wrote: > > > > > In your items controller, you have to set the layout, when you detect > > that

Re: ajax request using default.ctp instead of ajax.ctp

2010-02-11 Thread NickPick
thanks. that worked. On Feb 11, 7:38 pm, John Andersen wrote: > In your items controller, you have to set the layout, when you detect > that it is an AJAX request that you are processing. > See how to detect this > athttp://book.cakephp.org/view/350/Obtaining-Request-Information &g

Re: ajax request using default.ctp instead of ajax.ctp

2010-02-11 Thread John Andersen
In your items controller, you have to set the layout, when you detect that it is an AJAX request that you are processing. See how to detect this at http://book.cakephp.org/view/350/Obtaining-Request-Information And here for the layout http://book.cakephp.org/view/51/Controller-Attributes#Page

ajax request using default.ctp instead of ajax.ctp

2010-02-11 Thread NickPick
The below ajax request works well, but it's using default.ctp as layout file instad of ajax.ctp. How can I tell it to use ajax.ctp as layout file? thanks array( 'controller'=>'items', 'action'=&g

Re: Hiding an element based on data returned in Ajax request

2009-11-16 Thread lauraw
Well, I don't know how I ever got along without Firebug! Thanks for that Dave!! The good news is I found a workaround (at the very bottom here). The not so good news is that it looks like if you're updating multiple elements as part of an ajax request and you're complete callback

Re: Hiding an element based on data returned in Ajax request

2009-11-14 Thread lauraw
Thanks, Dave! I'll check that out. Makes complete sense. Oh, I found the $ajax->div() and $ajax->divEnd() methods in the cake 1.2 api documentation. That was a little while ago, but if I remember correctly, my ajax calls weren't updating the selection box data until I enclosed them in ajax divs. l

Re: Hiding an element based on data returned in Ajax request

2009-11-14 Thread lauraw
Scott, here is observeField() code below that triggers a call in the controller to get product categories, classes, types, brands, styles and sub-brands. And from David's response I need to change the 'loaded' option to 'complete' and figure out what kind of javascript error I'm getting... echo $f

Re: Hiding an element based on data returned in Ajax request

2009-11-14 Thread David Roda
f the select element >> >> if ( $("pstyle_sel").length == 0) >> $("style").hide(); >> >> this kind of works. The first time I select something that doesn't >> have styles, it doesn't hide the row. Next I selected something t

Re: Hiding an element based on data returned in Ajax request

2009-11-13 Thread David Roda
h of the select element > > if ( $("pstyle_sel").length == 0) > $("style").hide(); > > this kind of works. The first time I select something that doesn't > have styles, it doesn't hide the row. Next I selected something that > did have styl

Re: Hiding an element based on data returned in Ajax request

2009-11-13 Thread Scott Dahl
ave styles and it HID THE ROW. It's like it's seeing the data > from the previous ajax request, like it's one step behind? > > I'm using 'loaded' instead of 'complete' because when I used > 'complete' my ajax loading indicator just ke

Re: Hiding an element based on data returned in Ajax request

2009-11-13 Thread lauraw
").hide(); this kind of works. The first time I select something that doesn't have styles, it doesn't hide the row. Next I selected something that did have styles and it HID THE ROW. It's like it's seeing the data from the previous ajax request, like it's one step behi

Re: Hiding an element based on data returned in Ajax request

2009-11-13 Thread David Roda
ajax->observeField. The update is working great, > > but I would like to be able to hide the row if no styles are returned > > by the Ajax request. > > > > My view code is: > > > > > > Product Style: > > > >

Re: Hiding an element based on data returned in Ajax request

2009-11-13 Thread John Andersen
he update is working great, > but I would like to be able to hide the row if no styles are returned > by the Ajax request. > > My view code is: > > >         Product Style: >         >                                                

Hiding an element based on data returned in Ajax request

2009-11-13 Thread lauraw
I have a row that includes a form selection of product styles and is being updated via an ajax->observeField. The update is working great, but I would like to be able to hide the row if no styles are returned by the Ajax request. My view code is: Product St

Re: Helpers and AJAX request

2009-11-09 Thread Amit
an > > AJAX response? > > > I have a form that contains a dropdown and a group of radio buttons. > > When a new item is selected from the dropdown, an XMLHTTPRequest is > > sent to the server to get the new collection of radio buttons. > > > Right now, my contro

Re: Helpers and AJAX request

2009-11-09 Thread Dr. Loboto
n a new item is selected from the dropdown, an XMLHTTPRequest is > sent to the server to get the new collection of radio buttons. > > Right now, my controller determines if its an AJAX request, queries > for the list of items, manually generates the HTML for the radio > buttons, and sends

Helpers and AJAX request

2009-11-09 Thread Amit
, my controller determines if its an AJAX request, queries for the list of items, manually generates the HTML for the radio buttons, and sends the response. I know that the View layer offers a FormHelper to "automagically" create the form element ($form->radio ()), is there anything simi

Re: "null" response on Ajax request

2009-10-29 Thread Dr. Loboto
To avoid such problems I set debug to 0 at the very end of AJAX view/ layout. So If there are errors - I see them and can fix, if there are no errors - response is clear of debug data. On Oct 29, 5:55 pm, Thanos Atskakanis wrote: > it was set to 2 but AjaxHandler component was setting it back to

Re: "null" response on Ajax request

2009-10-29 Thread Thanos Atskakanis
it was set to 2 but AjaxHandler component was setting it back to 0 - disabled it and found out that the problem was coming from a missing file in the live server - rookie error :o) thanks a lot for that On Thu, Oct 29, 2009 at 4:04 AM, Dr. Loboto wrote: > > Set debug to at least 1 (and no mat

Re: "null" response on Ajax request

2009-10-28 Thread Dr. Loboto
Set debug to at least 1 (and no matter that it is ajax) to see error. On Oct 28, 10:34 pm, Thanos Atskakanis wrote: > Hi all, > > I am currently building a CMS and my system does some ajax requests which > return some html: simple and nice. > When I run it locally it all works fine but when I pu

"null" response on Ajax request

2009-10-28 Thread Thanos Atskakanis
Hi all, I am currently building a CMS and my system does some ajax requests which return some html: simple and nice. When I run it locally it all works fine but when I put it live instead of the expected html I get "null". Not "Not found" or any other error, just the word "null". All I use is the

RE: Is Ajax request

2009-10-22 Thread Dave Maharaj :: WidePixels.com
er-22-09 7:42 AM To: CakePHP Subject: Re: Is Ajax request How is the HTML looking? Does it look the same as the other links? Enjoy, John On Oct 21, 6:59 pm, "Dave Maharaj :: WidePixels.com" wrote: > I have this function where its first called normally by a link (http >

Re: Is Ajax request

2009-10-22 Thread John Andersen
How is the HTML looking? Does it look the same as the other links? Enjoy, John On Oct 21, 6:59 pm, "Dave Maharaj :: WidePixels.com" wrote: > I have this function where its first called normally by a link (http > request). Once loaded the pagination links are done via Ajax. I have 'all', > 'ne

Is Ajax request

2009-10-21 Thread Dave Maharaj :: WidePixels.com
I have this function where its first called normally by a link (http request). Once loaded the pagination links are done via Ajax. I have 'all', 'new', 'archive' links which all get called to paginate the result using Ajax and jquery. Problem is when i go to posts/index it works fine, click 'all'

Re: CakePHP Timeout when sending Ajax-Request?

2009-07-28 Thread brian
A timeout where? In Cake, or javascript? I don't kow about Prototype (what Cake's AjaxHelper uses), but jQuery allows to set a timeout. But you should ensure that you have debug set to 0, first of all. That will always slow things down somewhat. Also, look into caching--perhaps the problem is due

Re: CakePHP Timeout when sending Ajax-Request?

2009-07-28 Thread moe
Does nobody know how to solve this problem? --~--~-~--~~~---~--~~ 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

Re: Redirect after AJAX request

2009-07-24 Thread NOSLOW
hey DatacenterHellas, Your best bet is to not login via an AJAX call. Just set "standardSubmit: true" in your ExtJS login FormPanel config and call "MyFormPanel.getForm().submit({method: 'POST'});". Now you can let CakePHP handler your redirects server-side. On failure, you login page will just r

Re: Redirect after AJAX request

2009-07-23 Thread DatacenterHellas
Thanks all of you for your assistance :) --~--~-~--~~~---~--~~ 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 c

Re: Redirect after AJAX request

2009-07-23 Thread brian
You can't redirect from the server (PHP) when making an AJAX request. You can only send a response back to the client. If your server code determines that the user needs to be redirected, it should inform your client-side code--the javascript function making the AJAX request--that *it* s

Re: Redirect after AJAX request

2009-07-23 Thread DatacenterHellas
Ok . . . this is one aproach of the problem but I think is not the most correct. I mean what about if the user will not enter correct data ? ? ? Have I to redirect him to an action and then will return again to login ? ? ? Is not so nice. My project is based on CakePHP and ExtJS. For the Log

Re: Redirect after AJAX request

2009-07-23 Thread Dardo Sordi Bogado
window.location = url On Thu, Jul 23, 2009 at 1:16 PM, DatacenterHellas wrote: > > Hello all. > > How can I redirect after AJAX login to another action > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP"

Redirect after AJAX request

2009-07-23 Thread DatacenterHellas
Hello all. How can I redirect after AJAX login to another action --~--~-~--~~~---~--~~ 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 thi

CakePHP Timeout when sending Ajax-Request?

2009-07-23 Thread moe
Hey, I'm new to the CakePHP-Group. I joined, because I wasn't able to find any help on this. I've built a small project management interface on Cake. All actions are done with Ajax (jQuery), so that the page doesn't have to be reloaded. Normally the website is started at morning and remains open

Re: Stop AJAX Request

2009-07-15 Thread brian
d, Jul 15, 2009 at 5:01 AM, Luke wrote: > > Hi, > > I am still working on my first Cake Project and I am now stuck in some > AJAX Request where I would need some feedback. > > I am trying to achieve the following. > > I have recipes everybody can see. There is a link above the

Re: Stop AJAX Request

2009-07-15 Thread Piotr Kilczuk
Hello, > I have tried this out to understand the structure behind it but get > > Query: removeFavorite > > So it must be the below line, but what is the issue with this code? > Why is it using the method as a query? > > $success = $this->Product->User->removeFavorite($id); > > > I can't see what

Re: Stop AJAX Request

2009-07-15 Thread Luke
Hi, Oh, so I can not re-send the complete Page when I realise the User is not logged in!? So I will have to re-think my idea. I really thought that there is a possibility, but good that you have given a clear "No, not possible" I have now tried something out from the IBM Tutorial, its a bit of

Re: Stop AJAX Request

2009-07-15 Thread rchavik
i, > > I am still working on my first Cake Project and I am now stuck in some > AJAX Request where I would need some feedback. > > I am trying to achieve the following. > > I have recipes everybody can see. There is a link above the recipe to > add it to your favorites. If you

Stop AJAX Request

2009-07-15 Thread Luke
Hi, I am still working on my first Cake Project and I am now stuck in some AJAX Request where I would need some feedback. I am trying to achieve the following. I have recipes everybody can see. There is a link above the recipe to add it to your favorites. If you are logged in the page should

Re: ajax request after session expired - how to redirect to the front page?

2009-06-07 Thread brian
It can't be done from the server if it's an asynchronous request. You'll have to do it with javascript. Perhaps you could send back a particular response if you wish to redirect and have your JS callback look for it. If it's found, use document.location = ... On Sun, Jun 7, 2009 at 9:34 AM, Mar

ajax request after session expired - how to redirect to the front page?

2009-06-07 Thread MarcS
Hi everyone. I have a site that is farely heavy on AJAX. Sometimes it happens that the Session has expired and the user needs to log in again. Is there a way that I can detect that and send the surfer to the log in page instead of the login page loading inside the dom container? --~--~-~-

Re: Problem with Auth. with an AJAX Request

2009-05-21 Thread christo
well, i haven't done this specifically so I'm not sure I can demonstrate exactly how, but you probably either have to allow ('addToWatchlist') in your before filter then instead test if the request comes from a logged in user in that action before you add the link to the watch list. If it does NOT

Re: If not Ajax request

2009-05-20 Thread Dr. Loboto
ler. > > How would I implement the idea you mention? > > Thanks, > > Dave > > -Original Message- > From: Dr. Loboto [mailto:drlob...@gmail.com] > Sent: May-20-09 12:58 PM > To: CakePHP > Subject: Re: If not Ajax request > > I almost can swear tha

Help with AJAX request.

2009-05-20 Thread Dave Maharaj :: WidePixels.com
I have an ajax request which works fine. I am testing out secnarios that the end user may try in advance to see what would happen. My link in the view; link(' ', array('controller'=>'journal','action'=>'quicksave',$journal['Journal&

Re: Problem with Auth. with an AJAX Request

2009-05-20 Thread Luke
Hi, I am not sure what else I could copy & paste from the sourcecode. I only have a normal login action, in my user controller, which only saves the last login and thats pretty much it. An Login AJAX action? How would this look? Have you got an example? Thanks. Luke On 20 Mai, 22:18, christo w

Re: Problem with Auth. with an AJAX Request

2009-05-20 Thread christo
all I can think of is that you don't have a login AJAX action set up so the request dies without redirecting to a log in if you try to access the link from not logged in? I dunno it's hard to tell from your description. pastebin maybe? On May 20, 10:58 am, Luke wrote: > Hi, > > I have again re

RE: If not Ajax request

2009-05-20 Thread Dave Maharaj :: WidePixels.com
hered from the Auth id and the variable passed in the URL link in the controller. How would I implement the idea you mention? Thanks, Dave -Original Message- From: Dr. Loboto [mailto:drlob...@gmail.com] Sent: May-20-09 12:58 PM To: CakePHP Subject: Re: If not Ajax request I almost can

Re: Problem with Auth. with an AJAX Request

2009-05-20 Thread Luke
Hi, I have again read backwards and forwards through the www to find a solution for my problem. I am sure that there is other people running into the same issue. How do you guys solve it? All I want is a link saying "Add article to watchlist" which than, if the User is logged in writes it into t

RE: If not Ajax request

2009-05-20 Thread Dave Maharaj :: WidePixels.com
Ajax request I almost can swear that you tested it in IE and after save no actual request to server was done at all (can be checked in Apache access logs) - you saw cached result of previous save call. If yes, only addition of any random param to form action (or whatever you request on "

Re: If not Ajax request

2009-05-20 Thread Dr. Loboto
I almost can swear that you tested it in IE and after save no actual request to server was done at all (can be checked in Apache access logs) - you saw cached result of previous save call. If yes, only addition of any random param to form action (or whatever you request on "save" click) will save

If not Ajax request

2009-05-20 Thread Dave Maharaj :: WidePixels.com
I am trying to make sure the requested function is Ajax, if not redirect...so if someone tries to manually enter it into the url it redirects them back to the index page but not working the way i want. This is what happens: Scenario 1: original URL: localhost/testsite/journal/256 If someone goes to

Re: Problem with Auth. with an AJAX Request

2009-05-19 Thread Luke
Hi brian, thanks for your response. This is not really a solution I am looking for. I think the link should still be visible all the time and I can't imagine that cake and AJAX would not be able to handle this somehow. I am sure that someone has faced a similar issue before and I am hoping that t

Re: Problem with Auth. with an AJAX Request

2009-05-19 Thread brian
An AJAX request returns a chunk of HTML (or other data) and isn't going to handle the redirect properly. The simplest way to deal with this is to only display the link if the user is logged in. On Tue, May 19, 2009 at 8:36 AM, Luke wrote: > > Hi, > > I am still pretty new to

  1   2   >