It is described as such quite plainly in the documentation:

"In this example, clicking the 'Delete this post' link will issue a call to
the post/delete action in the background. The response returned by the
server will appear in the element of *id feedback*"

http://www.symfony-project.org/book/1_2/11-Ajax-Integration#chapter_11_sub_ajax_link

On Thu, Oct 22, 2009 at 1:12 PM, dziobacz <aaabbbcccda...@gmail.com> wrote:

>
> I want to delete posts from my forum without refresh page but now
> after clicked link 'Delete post' post is deleting without refreshing
> page but it is still showing - I must refresh page and then it isn't
> showing - why ?
>
> I have actions:
>
> class forumActions extends sfActions
> {
>
>  public function executeIndex(sfWebRequest $request)
>  {
>    $this->posts = Doctrine::getTable('Posts')->getPosts();
>  }
>
>  public function executeDelete(sfWebRequest $request)
>  {
>        if ($request->isXmlHttpRequest())
>        {
>                $post =
> Doctrine::getTable('Posts')->find($request->getParameter
> ('post'));
>                $post->delete();
>
>                $this->posts = Doctrine::getTable('Posts')->getPosts();
>        }
>  }
>
>
> And my template indexSuccess.php:
>
> <?php use_helper('Javascript') ?>
>
> <div class="ajaxclass">
> <?php foreach ($posts as $x): ?>
>
>        <?php echo $x->getPost();       ?>
>       <br/>
>
>        <?php echo link_to_remote('Delete post', array(
>        'update' => 'ajaxclass',
>        'url'    => '/forum/delete/post/'.$x->getId(),
>        )) ?>
>
>        <br/><br/>
>
> <?php endforeach; ?>
> </div>
> >
>


-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to