Will do, stay tunes ;) Regards, Saša Stamenković
On Thu, Mar 25, 2010 at 4:25 PM, Hector Virgen <[email protected]> wrote: > That seems fine to me, but there may be something else creating a request > for that action without ajax. Can you add some logging in your action to log > the request? It might give you some details as to what's happening when it > errors. > > -- > Hector > > > > On Thu, Mar 25, 2010 at 8:18 AM, Саша Стаменковић <[email protected]>wrote: > >> <?php >> class PretragaController extends Zend_Controller_Action { >> >> >> public function init() { >> $this->_helper->ajaxContext >> ->setActionContext('uzmi-modele', 'html') >> ->setActionContext('oglasi-broj', 'json') >> ->setActionContext('kontakt', 'html') >> ->initContext(); >> } >> >> //.... >> >> public function oglasiBrojAction() { >> $car = new Automobili_Model_Table_Car(); >> $form = new Automobili_Form_QuickSearch(); >> $form->populate($this->_getAllParams()); >> >> $this->view->count = $car->searchCount($form); >> } >> >> } >> >> Everithing is done via helper, but for some reason, sometimes, insted >> looking for 'pretraga/oglasi-broj.ajax.phtml' it looks for >> 'pretraga/oglasi-broj.phtml'. This can be reproduced with visiting action >> directly without ajax. >> >> For me this is the problem since all I get whole day is errors like this. >> I really want to know the reason, why this happends. >> >> Regards, >> Saša Stamenković >> >> >> >> On Thu, Mar 25, 2010 at 4:14 PM, Hector Virgen <[email protected]>wrote: >> >>> Are you manually calling $this->render() in your action, or do you have a >>> controller plugin or helper that is calling it? >>> >>> -- >>> Hector >>> >>> >>> >>> On Thu, Mar 25, 2010 at 8:12 AM, Саша Стаменковић <[email protected]>wrote: >>> >>>> My ajax calls always send the format parameters. >>>> >>>> Now I see that I have one json action, that is triggered ONLY from >>>> javascript, so no user will type /some/action/format/json in the location >>>> bar of the browser, but still I get >>>> >>>> exception 'Zend_View_Exception' with message 'script 'some/action.phtml' >>>> not found in path... >>>> >>>> >>>> Regards, >>>> Saša Stamenković >>>> >>>> >>>> >>>> On Thu, Mar 25, 2010 at 4:09 PM, A.J. Brown <[email protected]> wrote: >>>> >>>>> Correction: obviously ajaxContext does use the format parameter. I'm >>>>> not sure what I was thinking :) >>>>> >>>>> >>>>> On Thu, Mar 25, 2010 at 11:06 AM, A.J. Brown <[email protected]> >>>>> wrote: >>>>> > Actually, I believe that ajaxContext does not use the "format" >>>>> request >>>>> > parameter. Your problem is likely that the client is not sending the >>>>> > proper headers. >>>>> > >>>>> > Your best solution would be to use the contextSwitch helper instead, >>>>> > and change your AJAX calls to pass the format parameter, or to throw >>>>> > an exception when !$this->getRequest()->isXmlHttpRequest() for >>>>> actions >>>>> > that MUST be called via AJAX. You might even want to put all of >>>>> these >>>>> > calls in their own controller, and throw the error to remain DRY. >>>>> > >>>>> > >>>>> > On Thu, Mar 25, 2010 at 2:58 AM, Саша Стаменковић < >>>>> [email protected]> wrote: >>>>> >> I thinks second requirement is there, but XMLHttpRequest is not. >>>>> Otherwise, >>>>> >> it would always fail. >>>>> >> >>>>> >> Regards, >>>>> >> Saša Stamenković >>>>> >> >>>>> >> >>>>> >> On Wed, Mar 24, 2010 at 6:15 PM, Jurian Sluiman < >>>>> [email protected]> >>>>> >> wrote: >>>>> >>> >>>>> >>> On Tuesday 23 Mar 2010 20:15:03 Саша Стаменковић wrote: >>>>> >>> > Interesting. Is there a way to solve it on one place. What is >>>>> enough for >>>>> >>> > me >>>>> >>> > is to prevent logging errors in error controller. >>>>> >>> > So custom exception thrown from controller plugin is fine...if >>>>> ajax >>>>> >>> > action >>>>> >>> > is called without ajax. >>>>> >>> > >>>>> >>> > Regards, >>>>> >>> > Saša Stamenković >>>>> >>> >>>>> >>> Solving the problem in one place means you need to extend the >>>>> ajaxContext >>>>> >>> action helper to check for specific non-Ajax requests. >>>>> >>> -- >>>>> >>> Jurian Sluiman >>>>> >>> CTO Soflomo V.O.F. >>>>> >>> http://soflomo.com >>>>> >> >>>>> >> >>>>> > >>>>> > >>>>> > >>>>> > -- >>>>> > A.J. Brown >>>>> > Software Engineer, ZCE >>>>> > blog : http://ajbrown.org >>>>> > talk : (937) 540-0099 >>>>> > chat : IntypicaAJ >>>>> > >>>>> >>>>> >>>>> >>>>> -- >>>>> A.J. Brown >>>>> Software Engineer, ZCE >>>>> blog : http://ajbrown.org >>>>> talk : (937) 540-0099 >>>>> chat : IntypicaAJ >>>>> >>>> >>>> >>> >> >
