[symfony-users] Re: form_remote_tag and updating multiple divs

2008-09-18 Thread Kero

this snippet is also helpfull to update multiple divs:
http://www.symfony-project.org/snippets/snippet/116

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: form_remote_tag and updating multiple divs

2008-08-20 Thread laura

this worked. thanks everyone!

laura

On Aug 20, 9:48 am, lionslair <[EMAIL PROTECTED]> wrote:
> On Aug 20, 5:15 am, "Pedro Bastos" <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
>
> > I can see two possible solutions for your question:
>
> > a) Set a handler on your Ajax.Update object. Insert complete in your
> > options. Eg:
>
> >  >   'update'   => 'badgeHolder',
> >   'url'      => '@login_badge',
> >   'complete' => 'executeWhenFinished(request)'
> >  )) ?>
>
> >  Then you have to create a javascript handler to update any DOM object.
>
> > b) Set a global Ajax handler. Insert this BEFORE you execute Ajax.Updater:
>
> > Ajax.Responders.register({
> >   onComplete: function(){
> >     // handle all Ajax requests
> >   }
>
> > });
>
> > This will handle ALL xmlHttpRequest requests made in your page.
>
> > I suggest you to use the first one. It is clean and easy.
>
> > Questions? Reply back. :)
>
> > Pedro
>
> > On Tue, Aug 19, 2008 at 1:29 PM, laura <[EMAIL PROTECTED]> wrote:
>
> > > hi-
>
> > > i've seen this type of question posted elsewhere, but haven't been
> > > able to figure out how to do it. i have a form_remote_tag that logs a
> > > user into our site. upon login, it updates the login div to be a
> > > logged-in div. but, i also have a component at the top of the page
> > > that needs to be updated:
>
> > >  > >  'update'   => 'badgeHolder',
> > >  'url'      => '@login_badge',
> > > )) ?>
>
> > > there other div has a component in it that would need to be swapped
> > > out upon logging in.
>
> > > so to summarize, how would i update 2 components upon submitting the
> > > form?
>
> > > thanks!
>
> > > laura
>
> Remote function is what I use
>
>      'update'   => 'badgeHolder',
>    'url'      => '@login_badge',
>    'complete' => remote_function(array(
>                                                          'url' =>
> 'ModuleName/ActionName',
>                                                          ''update =>
> 'name_of_second_div',
>                                                         'script' =>
> TRUE,
> )),
> 'script' => TRUE,
>   )) ?>
>
> Remember to always add 'script' => TRUE, to all of your javascript
> helpers.  Even if its nested ADD IT- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: form_remote_tag and updating multiple divs

2008-08-20 Thread lionslair



On Aug 20, 5:15 am, "Pedro Bastos" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I can see two possible solutions for your question:
>
> a) Set a handler on your Ajax.Update object. Insert complete in your
> options. Eg:
>
>    'update'   => 'badgeHolder',
>   'url'      => '@login_badge',
>   'complete' => 'executeWhenFinished(request)'
>  )) ?>
>
>  Then you have to create a javascript handler to update any DOM object.
>
> b) Set a global Ajax handler. Insert this BEFORE you execute Ajax.Updater:
>
> Ajax.Responders.register({
>   onComplete: function(){
>     // handle all Ajax requests
>   }
>
> });
>
> This will handle ALL xmlHttpRequest requests made in your page.
>
> I suggest you to use the first one. It is clean and easy.
>
> Questions? Reply back. :)
>
> Pedro
>
> On Tue, Aug 19, 2008 at 1:29 PM, laura <[EMAIL PROTECTED]> wrote:
>
> > hi-
>
> > i've seen this type of question posted elsewhere, but haven't been
> > able to figure out how to do it. i have a form_remote_tag that logs a
> > user into our site. upon login, it updates the login div to be a
> > logged-in div. but, i also have a component at the top of the page
> > that needs to be updated:
>
> >  >  'update'   => 'badgeHolder',
> >  'url'      => '@login_badge',
> > )) ?>
>
> > there other div has a component in it that would need to be swapped
> > out upon logging in.
>
> > so to summarize, how would i update 2 components upon submitting the
> > form?
>
> > thanks!
>
> > laura

Remote function is what I use

  'badgeHolder',
   'url'  => '@login_badge',
   'complete' => remote_function(array(
 'url' =>
'ModuleName/ActionName',
 ''update =>
'name_of_second_div',
'script' =>
TRUE,
)),
'script' => TRUE,
  )) ?>


Remember to always add 'script' => TRUE, to all of your javascript
helpers.  Even if its nested ADD IT
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: form_remote_tag and updating multiple divs

2008-08-20 Thread Pedro Bastos

Hi Laura,


function executeWhenFinished(request)
{
Element.replace('othercontainer_id',$F('badgeHolder'));

// put other container updates here
}


Good luck,


Pedro

On Tue, Aug 19, 2008 at 5:38 PM, laura <[EMAIL PROTECTED]> wrote:
>
> hi pedro-
>
> bear with me, since i'm pretty new to ajax. can you give me an example
> of what would go in 'executeWhenFinished(request)'?
>
> l.
>
>
>
> On Aug 19, 5:15 pm, "Pedro Bastos" <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I can see two possible solutions for your question:
>>
>> a) Set a handler on your Ajax.Update object. Insert complete in your
>> options. Eg:
>>
>> >   'update'   => 'badgeHolder',
>>   'url'  => '@login_badge',
>>   'complete' => 'executeWhenFinished(request)'
>>  )) ?>
>>
>>  Then you have to create a javascript handler to update any DOM object.
>>
>> b) Set a global Ajax handler. Insert this BEFORE you execute Ajax.Updater:
>>
>> Ajax.Responders.register({
>>   onComplete: function(){
>> // handle all Ajax requests
>>   }
>>
>> });
>>
>> This will handle ALL xmlHttpRequest requests made in your page.
>>
>> I suggest you to use the first one. It is clean and easy.
>>
>> Questions? Reply back. :)
>>
>> Pedro
>>
>>
>>
>> On Tue, Aug 19, 2008 at 1:29 PM, laura <[EMAIL PROTECTED]> wrote:
>>
>> > hi-
>>
>> > i've seen this type of question posted elsewhere, but haven't been
>> > able to figure out how to do it. i have a form_remote_tag that logs a
>> > user into our site. upon login, it updates the login div to be a
>> > logged-in div. but, i also have a component at the top of the page
>> > that needs to be updated:
>>
>> > > >  'update'   => 'badgeHolder',
>> >  'url'  => '@login_badge',
>> > )) ?>
>>
>> > there other div has a component in it that would need to be swapped
>> > out upon logging in.
>>
>> > so to summarize, how would i update 2 components upon submitting the
>> > form?
>>
>> > thanks!
>>
>> > laura- Hide quoted text -
>>
>> - Show quoted text -
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: form_remote_tag and updating multiple divs

2008-08-19 Thread laura

hi pedro-

bear with me, since i'm pretty new to ajax. can you give me an example
of what would go in 'executeWhenFinished(request)'?

l.



On Aug 19, 5:15 pm, "Pedro Bastos" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I can see two possible solutions for your question:
>
> a) Set a handler on your Ajax.Update object. Insert complete in your
> options. Eg:
>
>    'update'   => 'badgeHolder',
>   'url'      => '@login_badge',
>   'complete' => 'executeWhenFinished(request)'
>  )) ?>
>
>  Then you have to create a javascript handler to update any DOM object.
>
> b) Set a global Ajax handler. Insert this BEFORE you execute Ajax.Updater:
>
> Ajax.Responders.register({
>   onComplete: function(){
>     // handle all Ajax requests
>   }
>
> });
>
> This will handle ALL xmlHttpRequest requests made in your page.
>
> I suggest you to use the first one. It is clean and easy.
>
> Questions? Reply back. :)
>
> Pedro
>
>
>
> On Tue, Aug 19, 2008 at 1:29 PM, laura <[EMAIL PROTECTED]> wrote:
>
> > hi-
>
> > i've seen this type of question posted elsewhere, but haven't been
> > able to figure out how to do it. i have a form_remote_tag that logs a
> > user into our site. upon login, it updates the login div to be a
> > logged-in div. but, i also have a component at the top of the page
> > that needs to be updated:
>
> >  >  'update'   => 'badgeHolder',
> >  'url'      => '@login_badge',
> > )) ?>
>
> > there other div has a component in it that would need to be swapped
> > out upon logging in.
>
> > so to summarize, how would i update 2 components upon submitting the
> > form?
>
> > thanks!
>
> > laura- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: form_remote_tag and updating multiple divs

2008-08-19 Thread Pedro Bastos

Hi,

I can see two possible solutions for your question:

a) Set a handler on your Ajax.Update object. Insert complete in your
options. Eg:

 'badgeHolder',
  'url'  => '@login_badge',
  'complete' => 'executeWhenFinished(request)'
 )) ?>

 Then you have to create a javascript handler to update any DOM object.

b) Set a global Ajax handler. Insert this BEFORE you execute Ajax.Updater:

Ajax.Responders.register({
  onComplete: function(){
// handle all Ajax requests
  }
});

This will handle ALL xmlHttpRequest requests made in your page.

I suggest you to use the first one. It is clean and easy.

Questions? Reply back. :)


Pedro



On Tue, Aug 19, 2008 at 1:29 PM, laura <[EMAIL PROTECTED]> wrote:
>
> hi-
>
> i've seen this type of question posted elsewhere, but haven't been
> able to figure out how to do it. i have a form_remote_tag that logs a
> user into our site. upon login, it updates the login div to be a
> logged-in div. but, i also have a component at the top of the page
> that needs to be updated:
>
>   'update'   => 'badgeHolder',
>  'url'  => '@login_badge',
> )) ?>
>
> there other div has a component in it that would need to be swapped
> out upon logging in.
>
> so to summarize, how would i update 2 components upon submitting the
> form?
>
> thanks!
>
> laura
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---