[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-11-16 Thread kowal grzes
If link is created then use FireBug to check where is problem.
You can check if request is sent and what came in response.

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



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-11-16 Thread kowal grzes


 I added this helper in my partial. Still not working :(

 But what is happening?
Link is generated? Maybe put some code from page source here so we can see
what was generated by this tag.

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



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-11-09 Thread Murali Krishna B
Hi all,

I am also facing the same problem in deleting posts with AJAX. The partial
is creating some random id's for delete links. But events are not added for
those links.
When it is done from template, I can see all delete links and their events.
But When I deleted a post from them, partial is creating links, which are
not working.

Any solutions for this?

Thanks,

Murali Krishna

2009/11/4 dziobacz aaabbbcccda...@gmail.com


 I have a solution - it isn't easy :) You have my idea here:

 a href=http://forum.symfony-project.org/index.php/t/23505/;http://
 forum.symfony-project.org/index.php/t/23505//a

 Is it a good solution ? It works but maybe it should be make in other
 way ?



 On 23 Paź, 19:47, Gareth McCumskey gmccums...@gmail.com wrote:
  a link_to_remote pointing at an action and that action processing on to a
  regular does not cause any problem whatsoever!
 
  Read the documentation again. Symfony automatically does not include the
  layout around a template file if it is being loaded in response to an
 Ajax
  request.
 
  2009/10/23 Raphael raphox.ara...@gmail.com
 
 
 
   yes Gareth, but.
   if only load a complete action, you load templates, debug_bar and
 others.
   if you dont know methos for drop this of request.
   because this I recomender render text or partial.
 
   On Fri, Oct 23, 2009 at 11:41 AM, Gareth McCumskey 
 gmccums...@gmail.comwrote:
 
   No you don't. You can load an action template inside a div using
   link_to_remote
 
   And FYI I use the link_to_remote all the time. An error 500 is an
   application error server side which you need to fix. Go through your
 code
   and debug as normal
 
   On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com
 wrote:
 
   its possible...
 
   because the ajax helpers dont has in core symfony after 1.2
 
   but you error is in dont uses:
 
   return $this-renderText('('.$output.')');
 
   or
 
   return $this-renderPartial('partial', array('var1' = $var1));
 
   you are trying render an action, its not possible, you need text or
   partial in your ajax call.
 
   example:
  
 http://www.symfony-project.org/book/1_2/11-Ajax-Integration#chapter_1...
 
   On Thu, Oct 22, 2009 at 1:09 PM, dziobacz aaabbbcccda...@gmail.com
 wrote:
 
   really nobody used link_to_remote() ??
 
   On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
ok thx, but now after deleted post I see inside div 'ajaxclass'
 (where
should be posts) small website with 500 error :(
 
On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:
 
 The link_to_remote function needs a div ID passed not a div
 CLASS.
   So div
 class=ajaxclass should be div id=ajaxclass
 
 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 McCumskeyhttp://garethmccumskey.blogspot.com
 twitter: @garethmcc
 
   --
   Raphael Almeida Araújo
   Homepage:http://sites.google.com/site/raphoxaraujo
 
   --
   Gareth McCumskey
 
  http://garethmccumskey.blogspot.com
   twitter: @garethmcc
 
   --
   Raphael Almeida Araújo
   Homepage:http://sites.google.com/site/raphoxaraujo
 
  --
  Gareth McCumskeyhttp://garethmccumskey.blogspot.com
  twitter: @garethmcc
 



-- 
Thanks  Regards,

Murali Krishna.B,

Yahoo! SDC

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

[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-11-09 Thread dziobacz

You must add in partial file '_yourpartialfile.php':

?php use_helper('Javascript') ?


On 9 Lis, 10:31, Murali Krishna B muralikrishna.vi...@gmail.com
wrote:
 Hi all,

 I am also facing the same problem in deleting posts with AJAX. The partial
 is creating some random id's for delete links. But events are not added for
 those links.
 When it is done from template, I can see all delete links and their events.
 But When I deleted a post from them, partial is creating links, which are
 not working.

 Any solutions for this?

 Thanks,

 Murali Krishna

 2009/11/4 dziobacz aaabbbcccda...@gmail.com





  I have a solution - it isn't easy :) You have my idea here:

  a href=http://forum.symfony-project.org/index.php/t/23505/;http://
  forum.symfony-project.org/index.php/t/23505//a

  Is it a good solution ? It works but maybe it should be make in other
  way ?

  On 23 Paź, 19:47, Gareth McCumskey gmccums...@gmail.com wrote:
   a link_to_remote pointing at an action and that action processing on to a
   regular does not cause any problem whatsoever!

   Read the documentation again. Symfony automatically does not include the
   layout around a template file if it is being loaded in response to an
  Ajax
   request.

   2009/10/23 Raphael raphox.ara...@gmail.com

yes Gareth, but.
if only load a complete action, you load templates, debug_bar and
  others.
if you dont know methos for drop this of request.
because this I recomender render text or partial.

On Fri, Oct 23, 2009 at 11:41 AM, Gareth McCumskey 
  gmccums...@gmail.comwrote:

No you don't. You can load an action template inside a div using
link_to_remote

And FYI I use the link_to_remote all the time. An error 500 is an
application error server side which you need to fix. Go through your
  code
and debug as normal

On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com
  wrote:

its possible...

because the ajax helpers dont has in core symfony after 1.2

but you error is in dont uses:

return $this-renderText('('.$output.')');

or

return $this-renderPartial('partial', array('var1' = $var1));

you are trying render an action, its not possible, you need text or
partial in your ajax call.

example:

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

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

really nobody used link_to_remote() ??

On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
 ok thx, but now after deleted post I see inside div 'ajaxclass'
  (where
 should be posts) small website with 500 error :(

 On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:

  The link_to_remote function needs a div ID passed not a div
  CLASS.
So div
  class=ajaxclass should be div id=ajaxclass

  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 McCumskeyhttp://garethmccumskey.blogspot.com
  twitter: @garethmcc

--
Raphael Almeida Araújo
Homepage:http://sites.google.com/site/raphoxaraujo

--
Gareth McCumskey

   http://garethmccumskey.blogspot.com
twitter: @garethmcc

--
Raphael Almeida Araújo
Homepage:http://sites.google.com/site/raphoxaraujo

   --
   Gareth McCumskeyhttp://garethmccumskey.blogspot.com
   twitter: @garethmcc

 --
 Thanks  Regards,

 Murali Krishna.B,

 Yahoo! SDC
--~--~-~--~~~---~--~~
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] Re: link_to_remote() - using ajax to delete posts

2009-11-09 Thread Murali Krishna B
Hi,

Thanks for reply,

I added this helper in my partial. Still not working :(

--
Murali

2009/11/9 dziobacz aaabbbcccda...@gmail.com


 You must add in partial file '_yourpartialfile.php':

 ?php use_helper('Javascript') ?


 On 9 Lis, 10:31, Murali Krishna B muralikrishna.vi...@gmail.com
 wrote:
  Hi all,
 
  I am also facing the same problem in deleting posts with AJAX. The
 partial
  is creating some random id's for delete links. But events are not added
 for
  those links.
  When it is done from template, I can see all delete links and their
 events.
  But When I deleted a post from them, partial is creating links, which are
  not working.
 
  Any solutions for this?
 
  Thanks,
 
  Murali Krishna
 
  2009/11/4 dziobacz aaabbbcccda...@gmail.com
 
 
 
 
 
   I have a solution - it isn't easy :) You have my idea here:
 
   a href=http://forum.symfony-project.org/index.php/t/23505/;http://
   forum.symfony-project.org/index.php/t/23505//a
 
   Is it a good solution ? It works but maybe it should be make in other
   way ?
 
   On 23 Paź, 19:47, Gareth McCumskey gmccums...@gmail.com wrote:
a link_to_remote pointing at an action and that action processing on
 to a
regular does not cause any problem whatsoever!
 
Read the documentation again. Symfony automatically does not include
 the
layout around a template file if it is being loaded in response to an
   Ajax
request.
 
2009/10/23 Raphael raphox.ara...@gmail.com
 
 yes Gareth, but.
 if only load a complete action, you load templates, debug_bar and
   others.
 if you dont know methos for drop this of request.
 because this I recomender render text or partial.
 
 On Fri, Oct 23, 2009 at 11:41 AM, Gareth McCumskey 
   gmccums...@gmail.comwrote:
 
 No you don't. You can load an action template inside a div using
 link_to_remote
 
 And FYI I use the link_to_remote all the time. An error 500 is an
 application error server side which you need to fix. Go through
 your
   code
 and debug as normal
 
 On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com
 
   wrote:
 
 its possible...
 
 because the ajax helpers dont has in core symfony after 1.2
 
 but you error is in dont uses:
 
 return $this-renderText('('.$output.')');
 
 or
 
 return $this-renderPartial('partial', array('var1' = $var1));
 
 you are trying render an action, its not possible, you need text
 or
 partial in your ajax call.
 
 example:
 
  http://www.symfony-project.org/book/1_2/11-Ajax-Integration#chapter_1.
 ..
 
 On Thu, Oct 22, 2009 at 1:09 PM, dziobacz 
 aaabbbcccda...@gmail.com
   wrote:
 
 really nobody used link_to_remote() ??
 
 On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
  ok thx, but now after deleted post I see inside div
 'ajaxclass'
   (where
  should be posts) small website with 500 error :(
 
  On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com
 wrote:
 
   The link_to_remote function needs a div ID passed not a div
   CLASS.
 So div
   class=ajaxclass should be div id=ajaxclass
 
   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 McCumskeyhttp://garethmccumskey.blogspot.com
   twitter: @garethmcc
 
 --
 Raphael Almeida Araújo
 Homepage:http://sites.google.com/site/raphoxaraujo
 
 --
 Gareth McCumskey
 
http://garethmccumskey.blogspot.com
 twitter: @garethmcc
 
 --
 Raphael Almeida Araújo
 Homepage:http://sites.google.com/site/raphoxaraujo
 
--

[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-11-09 Thread dziobacz

Maybe try include in frontend\(or backend)\config\view.yml:
javascripts:[jquery]
And download jquery from: http://jquery.com/
and add it to web\js

Then: symfony cc


On 9 Lis, 11:15, Murali Krishna B muralikrishna.vi...@gmail.com
wrote:
 Hi,

 Thanks for reply,

 I added this helper in my partial. Still not working :(

 --
 Murali

 2009/11/9 dziobacz aaabbbcccda...@gmail.com





  You must add in partial file '_yourpartialfile.php':

  ?php use_helper('Javascript') ?

  On 9 Lis, 10:31, Murali Krishna B muralikrishna.vi...@gmail.com
  wrote:
   Hi all,

   I am also facing the same problem in deleting posts with AJAX. The
  partial
   is creating some random id's for delete links. But events are not added
  for
   those links.
   When it is done from template, I can see all delete links and their
  events.
   But When I deleted a post from them, partial is creating links, which are
   not working.

   Any solutions for this?

   Thanks,

   Murali Krishna

   2009/11/4 dziobacz aaabbbcccda...@gmail.com

I have a solution - it isn't easy :) You have my idea here:

a href=http://forum.symfony-project.org/index.php/t/23505/;http://
forum.symfony-project.org/index.php/t/23505//a

Is it a good solution ? It works but maybe it should be make in other
way ?

On 23 Paź, 19:47, Gareth McCumskey gmccums...@gmail.com wrote:
 a link_to_remote pointing at an action and that action processing on
  to a
 regular does not cause any problem whatsoever!

 Read the documentation again. Symfony automatically does not include
  the
 layout around a template file if it is being loaded in response to an
Ajax
 request.

 2009/10/23 Raphael raphox.ara...@gmail.com

  yes Gareth, but.
  if only load a complete action, you load templates, debug_bar and
others.
  if you dont know methos for drop this of request.
  because this I recomender render text or partial.

  On Fri, Oct 23, 2009 at 11:41 AM, Gareth McCumskey 
gmccums...@gmail.comwrote:

  No you don't. You can load an action template inside a div using
  link_to_remote

  And FYI I use the link_to_remote all the time. An error 500 is an
  application error server side which you need to fix. Go through
  your
code
  and debug as normal

  On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com

wrote:

  its possible...

  because the ajax helpers dont has in core symfony after 1.2

  but you error is in dont uses:

  return $this-renderText('('.$output.')');

  or

  return $this-renderPartial('partial', array('var1' = $var1));

  you are trying render an action, its not possible, you need text
  or
  partial in your ajax call.

  example:

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

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

  really nobody used link_to_remote() ??

  On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
   ok thx, but now after deleted post I see inside div
  'ajaxclass'
(where
   should be posts) small website with 500 error :(

   On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com
  wrote:

The link_to_remote function needs a div ID passed not a div
CLASS.
  So div
class=ajaxclass should be div id=ajaxclass

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 McCumskeyhttp://garethmccumskey.blogspot.com

[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-11-03 Thread dziobacz

I have a solution - it isn't easy :) You have my idea here:

a href=http://forum.symfony-project.org/index.php/t/23505/;http://
forum.symfony-project.org/index.php/t/23505//a

Is it a good solution ? It works but maybe it should be make in other
way ?



On 23 Paź, 19:47, Gareth McCumskey gmccums...@gmail.com wrote:
 a link_to_remote pointing at an action and that action processing on to a
 regular does not cause any problem whatsoever!

 Read the documentation again. Symfony automatically does not include the
 layout around a template file if it is being loaded in response to an Ajax
 request.

 2009/10/23 Raphael raphox.ara...@gmail.com



  yes Gareth, but.
  if only load a complete action, you load templates, debug_bar and others.
  if you dont know methos for drop this of request.
  because this I recomender render text or partial.

  On Fri, Oct 23, 2009 at 11:41 AM, Gareth McCumskey 
  gmccums...@gmail.comwrote:

  No you don't. You can load an action template inside a div using
  link_to_remote

  And FYI I use the link_to_remote all the time. An error 500 is an
  application error server side which you need to fix. Go through your code
  and debug as normal

  On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com wrote:

  its possible...

  because the ajax helpers dont has in core symfony after 1.2

  but you error is in dont uses:

  return $this-renderText('('.$output.')');

  or

  return $this-renderPartial('partial', array('var1' = $var1));

  you are trying render an action, its not possible, you need text or
  partial in your ajax call.

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

  On Thu, Oct 22, 2009 at 1:09 PM, dziobacz aaabbbcccda...@gmail.comwrote:

  really nobody used link_to_remote() ??

  On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
   ok thx, but now after deleted post I see inside div 'ajaxclass' (where
   should be posts) small website with 500 error :(

   On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:

The link_to_remote function needs a div ID passed not a div CLASS.
  So div
class=ajaxclass should be div id=ajaxclass

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 McCumskeyhttp://garethmccumskey.blogspot.com
twitter: @garethmcc

  --
  Raphael Almeida Araújo
  Homepage:http://sites.google.com/site/raphoxaraujo

  --
  Gareth McCumskey

 http://garethmccumskey.blogspot.com
  twitter: @garethmcc

  --
  Raphael Almeida Araújo
  Homepage:http://sites.google.com/site/raphoxaraujo

 --
 Gareth McCumskeyhttp://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
-~--~~~~--~~--~--~---



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-10-23 Thread Gareth McCumskey
No you don't. You can load an action template inside a div using
link_to_remote

And FYI I use the link_to_remote all the time. An error 500 is an
application error server side which you need to fix. Go through your code
and debug as normal

On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com wrote:

 its possible...

 because the ajax helpers dont has in core symfony after 1.2

 but you error is in dont uses:

 return $this-renderText('('.$output.')');

 or

 return $this-renderPartial('partial', array('var1' = $var1));

 you are trying render an action, its not possible, you need text or partial
 in your ajax call.

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



 On Thu, Oct 22, 2009 at 1:09 PM, dziobacz aaabbbcccda...@gmail.comwrote:


 really nobody used link_to_remote() ??

 On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
  ok thx, but now after deleted post I see inside div 'ajaxclass' (where
  should be posts) small website with 500 error :(
 
  On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:
 
   The link_to_remote function needs a div ID passed not a div CLASS. So
 div
   class=ajaxclass should be div id=ajaxclass
 
   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 McCumskeyhttp://garethmccumskey.blogspot.com
   twitter: @garethmcc
 
 




 --
 Raphael Almeida Araújo
 Homepage: http://sites.google.com/site/raphoxaraujo


 



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



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-10-23 Thread Raphael
yes Gareth, but.
if only load a complete action, you load templates, debug_bar and others. if
you dont know methos for drop this of request.
because this I recomender render text or partial.

On Fri, Oct 23, 2009 at 11:41 AM, Gareth McCumskey gmccums...@gmail.comwrote:

 No you don't. You can load an action template inside a div using
 link_to_remote

 And FYI I use the link_to_remote all the time. An error 500 is an
 application error server side which you need to fix. Go through your code
 and debug as normal

 On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com wrote:

 its possible...

 because the ajax helpers dont has in core symfony after 1.2

 but you error is in dont uses:

 return $this-renderText('('.$output.')');

 or

 return $this-renderPartial('partial', array('var1' = $var1));

 you are trying render an action, its not possible, you need text or
 partial in your ajax call.

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



 On Thu, Oct 22, 2009 at 1:09 PM, dziobacz aaabbbcccda...@gmail.comwrote:


 really nobody used link_to_remote() ??

 On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
  ok thx, but now after deleted post I see inside div 'ajaxclass' (where
  should be posts) small website with 500 error :(
 
  On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:
 
   The link_to_remote function needs a div ID passed not a div CLASS. So
 div
   class=ajaxclass should be div id=ajaxclass
 
   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 McCumskeyhttp://garethmccumskey.blogspot.com
   twitter: @garethmcc
 
 




 --
 Raphael Almeida Araújo
 Homepage: http://sites.google.com/site/raphoxaraujo






 --
 Gareth McCumskey

 http://garethmccumskey.blogspot.com
 twitter: @garethmcc

 



-- 
Raphael Almeida Araújo
Homepage: http://sites.google.com/site/raphoxaraujo

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



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-10-23 Thread Gareth McCumskey
a link_to_remote pointing at an action and that action processing on to a
regular does not cause any problem whatsoever!

Read the documentation again. Symfony automatically does not include the
layout around a template file if it is being loaded in response to an Ajax
request.

2009/10/23 Raphael raphox.ara...@gmail.com

 yes Gareth, but.
 if only load a complete action, you load templates, debug_bar and others.
 if you dont know methos for drop this of request.
 because this I recomender render text or partial.

 On Fri, Oct 23, 2009 at 11:41 AM, Gareth McCumskey 
 gmccums...@gmail.comwrote:

 No you don't. You can load an action template inside a div using
 link_to_remote

 And FYI I use the link_to_remote all the time. An error 500 is an
 application error server side which you need to fix. Go through your code
 and debug as normal

 On Thu, Oct 22, 2009 at 5:25 PM, Raphael raphox.ara...@gmail.com wrote:

 its possible...

 because the ajax helpers dont has in core symfony after 1.2

 but you error is in dont uses:

 return $this-renderText('('.$output.')');

 or

 return $this-renderPartial('partial', array('var1' = $var1));

 you are trying render an action, its not possible, you need text or
 partial in your ajax call.

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



 On Thu, Oct 22, 2009 at 1:09 PM, dziobacz aaabbbcccda...@gmail.comwrote:


 really nobody used link_to_remote() ??

 On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
  ok thx, but now after deleted post I see inside div 'ajaxclass' (where
  should be posts) small website with 500 error :(
 
  On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:
 
   The link_to_remote function needs a div ID passed not a div CLASS.
 So div
   class=ajaxclass should be div id=ajaxclass
 
   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 McCumskeyhttp://garethmccumskey.blogspot.com
   twitter: @garethmcc
 
 




 --
 Raphael Almeida Araújo
 Homepage: http://sites.google.com/site/raphoxaraujo






 --
 Gareth McCumskey

 http://garethmccumskey.blogspot.com
 twitter: @garethmcc





 --
 Raphael Almeida Araújo
 Homepage: http://sites.google.com/site/raphoxaraujo

 



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



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-10-22 Thread Gareth McCumskey
The link_to_remote function needs a div ID passed not a div CLASS. So div
class=ajaxclass should be div id=ajaxclass

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



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-10-22 Thread Gareth McCumskey
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
-~--~~~~--~~--~--~---



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-10-22 Thread dziobacz

really nobody used link_to_remote() ??

On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
 ok thx, but now after deleted post I see inside div 'ajaxclass' (where
 should be posts) small website with 500 error :(

 On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:

  The link_to_remote function needs a div ID passed not a div CLASS. So div
  class=ajaxclass should be div id=ajaxclass

  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 McCumskeyhttp://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
-~--~~~~--~~--~--~---



[symfony-users] Re: link_to_remote() - using ajax to delete posts

2009-10-22 Thread Raphael
its possible...

because the ajax helpers dont has in core symfony after 1.2

but you error is in dont uses:

return $this-renderText('('.$output.')');

or

return $this-renderPartial('partial', array('var1' = $var1));

you are trying render an action, its not possible, you need text or partial
in your ajax call.

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


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


 really nobody used link_to_remote() ??

 On 22 Paź, 14:21, dziobacz aaabbbcccda...@gmail.com wrote:
  ok thx, but now after deleted post I see inside div 'ajaxclass' (where
  should be posts) small website with 500 error :(
 
  On 22 Paź, 14:13, Gareth McCumskey gmccums...@gmail.com wrote:
 
   The link_to_remote function needs a div ID passed not a div CLASS. So
 div
   class=ajaxclass should be div id=ajaxclass
 
   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 McCumskeyhttp://garethmccumskey.blogspot.com
   twitter: @garethmcc
 
 
 



-- 
Raphael Almeida Araújo
Homepage: http://sites.google.com/site/raphoxaraujo

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