Can you provide a URL to show this?


2009/4/8 BrentNicholas <brentnicho...@gmail.com>:
>
> Walter,
>
> Thanks for the reply. I didn't realize you could do some of the
> techniques you used.
>
> I don't think this is issue however. I checked the code for event/name
> conflicts, then loaded the app before I left and didn't click
> anything, came back and nothing on the interface works. I then loaded
> it, clicked into a screen I knew would not over write other events.
> Let it sit for 15mins, same result, none of the mapped event clicks
> seemed to work.
>
> However, it's always is rock solid if you start using it within a few
> minutes and keep using it but not waiting more than about 10 mins
> between use/click. Everything works in that manner of use.
>
> I have one thing I can chase down, but open to ideas.
>
> BN
>
> On Apr 7, 4:45 pm, Walter Lee Davis <wa...@wdstudio.com> wrote:
>> Not in my experience, no. But what does happen is that the
>> relationship set with Event.observe is a true relationship. If you
>> replace one element with another of the same name or ID, the
>> relationship is broken.
>>
>> One way to work around this (if you're going to use Ajax.Updater to
>> replace portions of your site, and you don't want to re-declare your
>> listeners each time through a callback) is to observe some event on
>> the document or another "parent" element that you never replace. Then
>> look at classname or item name or id or whatever in the
>> Event.element() function within that observer to decide what to do
>> with that click.
>>
>> <div id="foo">
>>         <div id="bar">
>>         </div>
>>         <div id="baz">
>>         </div>
>> </div>
>>
>> $('foo').observe('click',function(evt){
>>         var elm = Event.element(evt);
>>         //elm is now a reference to the element that
>>         //initiated the event
>>         switch(elm.id){
>>                 case 'bar':
>>                 //do something
>>                 break;
>>                 case 'baz':
>>                 //do something else
>>                 break;
>>                 default;
>>                 break;
>>         }
>>
>> });
>>
>> Now it doesn't matter at all what you do with #bar and #baz -- you can
>> replace them wholesale, and as long as there's something in the #foo
>> div with those IDs at the time that a click happens, the function will
>> Just Work™.
>>
>> Walter
>>
>> On Apr 7, 2009, at 6:33 PM, BrentNicholas wrote:
>>
>>
>>
>> > So does prototype time out, expire? Or is this some form of
>> > Event.observe mappings being lost when another ajax.request is made
>> > with new buttons (of different id names) mapped to functions with
>> > Event.observe?- Hide quoted text -
>>
>> - Show quoted text -
> >
>



-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

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

Reply via email to