Are you sure that render path is correct? Try doing:

$this->viewPath = 'elements';  // this is relative to views dir
$this->render('view_artists');

What do you mean by, "no luck"? What effect are you seeing?

Are you loading the form inside the 'view_artists' element area? Are
you replacing any content? If not, just make the cancel button remove
the edit form.

If you are replacing the 'view' content with the form, maybe you
should think about having it appended to the page instead so you can
remove it on cancel.

On Thu, Jan 29, 2009 at 11:45 PM, WidePixels <[email protected]> wrote:
>
> I have a ajax area on the page, simple click a link and it loads new
> content into a div.
>
> view:
> <div id="ajaxContent">
> <?php echo $this->element('view_artists'); ?>
> </div>
>
> I have a link that they can "edit artists" which loads the form.
> <a class="ajax" href="/artists/update_artists/<?php echo $User['User']
> ['id']
> ?>">Edit Artists</a>
>
> The edit_artists is a form to edit their selections. Now if they want
> to "Cancel" and not make any changes how do I go about loading the
> original "view_artists" element?
>
> i tried in the controller:
> function cancel()
>      {
>        $this->autoRender=false;
>        $this->layout = 'ajax';
>                $this->render('../elements/view_artists');
>    }
>
> but no luck.
>
> Anyone know what I am doing wrong?
>
> Thanks,
> Dave
> >
>

--~--~---------~--~----~------------~-------~--~----~
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