I have similar problem.
I have an element inside a view and I would on a click of a button
that the element would be reloaded with same params of first render.
Can someone suggest me some solution?


On Feb 28, 6:49 am, Corey Crawford <[email protected]> wrote:
> OK, finally getting a chance to look at this again. The biggest
> problem I'm having is passing variable information to theelement, so
> that it can reduce the scope of what's returned and filter based on a
> drop down selection.
>
> Here's some code snippets:
>
> http://bin.cakephp.org/view/168041585
>
> Basically, I've gotten it to call theelementfrom within a 'refresh'
> view, called by the controller. However, Firebug shows *no* data being
> sent in theAJAXPOST, so I can't seem to get the data for the formelementthat 
> changed. The debug log shows no data for $this->data when
> logged from the controller (homes).
>
> The CDATA for theAJAXobserver seems to be setup right:
> //<![CDATA[
> new Form.Element.EventObserver('booksubject', function(element, value)
> {newAjax.Request('/homes/latest_books_refresh', {asynchronous:true,
> evalScripts:true, parameters:Form.Element.serialize('booksubject')})})
> //]]>
>
> I tried wrapping it in a FORM tag but that didn't help. Any ideas what
> might be going on here?
>
> Thanks :)
>
>  - Corey Crawford
>
> On Feb 11, 9:25 am, WebbedIT <[email protected]> wrote:
>
> > As this is anAJAXrequest you are interfacing with the DOM and as
> > such it does not matter whether theelementto be updated was built
> > with a view orelement.  As long as you have the link/observer calling
> > a new instance ofajax.updater and have set it to update the required 
> > elementid then all should be happy.  Your refreshSearchElement action
> > needs a /home/refresh_search_element.ctp view and if you are using the
> > RequestHandler component  Cake should do all the rest for you.
>
> > Have you got FireBug installed? If so what POST and Response data does
> > it show for theajaxrequest?
>
> On Feb 11, 10:32 am, brian <[email protected]> wrote:
>
> > Sorry, I forgot something, actually
>
> > $this->layout = false;
> > $this->set('new_param', $new_param);
>
> > $this->viewPath = 'elements';
>
> > /*
> > OR:
> > $this->viewPath = 'elements'.DS.'some_other_dir';
> > */
>
> > $this->render('search_element_1');
>
> > This will force Cake to use only theelementto render the view.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to