Simple scenario:
Top div contains ajaxed, paginated index of items. Bottom div shows /
view when an item is selected from the index. You can choose to edit
the item in the bottom div, it ajaxes in the /edit form. On
susccessful submit, you redirect back to /view with flash saying
'Saved OK'.
This worked fine around RC1 and loaded my layout set in the controller
as $this->layout = 'ajaxpanel';
In RC3, I've tryed varous combinations of the following:
$this->autoRender = true/false;
$this->RequestHandler->ajaxLayout = 'ajaxpanel';
$this->RequestHandler->enabled = false;
But the layout does not load.
-Jason
On Nov 4, 11:10 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
> Why do you need to redirect inside an ajax request? I've never run
> into this requirement before.
>
> Cheers,
> Adam
>
> On Oct 15, 6:33 am, Julián Lastiri <[EMAIL PROTECTED]> wrote:
>
>
>
> > Well, i found that when i call redirect from an ajax request the
> > redirect is forwarded to the beforeRedirect method from RequestHandler
> > Component. This
> > method calls requestAction which sets bare in 1 and the dispatchers
> > does the following
>
> > if (!empty($this->params['bare'])) {
> > $controller->autoLayout = false;
> > }
>
> > When autoLayout is set to false the view doesn't call renderLayout
>
> > if ($layout && $this->autoLayout) {
> > $out = $this->renderLayout($out, $layout);
>
> > Anybody knows how do i tell cakephp to set autoLayout to true when i
> > call redirect from an ajax request ?
>
> > thanks
>
> > On Oct 14, 3:59 pm, Julián Lastiri <[EMAIL PROTECTED]> wrote:
>
> > > When i useredirectfrom anajaxrequest theajax.ctp is not rendered.
>
> > > I try calling setFlash withgrowl layout but doesn't work.
>
> > > I have a content div in my webpage. When i submit the form i save the
> > > data, then set a Flash message andredirectto the index.
> > > The index is loaded in the content div, but the message is not shown.
> > > If i put some debug comments like echo "debugging" on theajax.ctp
> > > layout theses comments are not printed.
> > > So i suspect that the view is not rendering the layout properly.
>
> > > any idea ?
>
> > > On Oct 13, 10:18 pm, "Andras Kende" <[EMAIL PROTECTED]> wrote:
>
> > > > this worked great for
> > > > me:http://blog.jaysalvat.com/articles/afficher-vos-messages-flash-cakeph...
> > > > delegantes-alertes-a-la-growl.php
>
> > > > did it for both flash and validation..
>
> > > > Andras
>
> > > > -----Original Message-----
> > > > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
>
> > > > Of Julián Lastiri
> > > > Sent: Monday, October 13, 2008 2:11 PM
> > > > To: CakePHP
> > > > Subject:AjaxRedirectand setFlash Messages
>
> > > > I'm using cakephp 1.2RC3
> > > > I want to show messages with setFlash method but when i useredirect
> > > > theajax.ctp layout is not rendered.
> > > > I'm using this code to show messages with jGrowl inside myajax.ctp
> > > > layout
>
> > > > <?php if ($session->check('Message.flash')): ?>
> > > > <script>
> > > > jQuery(document).ready(function(){
> > > > jQuery.jGrowl( "<?php echo $session-
> > > > >read('Message.flash.message');?>", {
> > > > life: 2000,
> > > > sticky: false,
> > > > header: '<?php echo $header;?>',
> > > > theme: '<?php echo $message_class;?>'
> > > > });
> > > > });
> > > > </script>
>
> > > > any idea ?
>
> > > > thanks !
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---