List Info

Thread: Problem with partial DOM update and Behaviour.apply() (behaviour 1.1)




Problem with partial DOM update and Behaviour.apply() (behaviour 1.1)
user name
2006-04-11 02:39:04
I am fully updating the contents of DIV with an Ajax.Updater
 and
cannot get Behaviour.apply to reapply my rules.  I have a
simple set of
rules:

var pfmRules = {
	"li.pfmList" : function(el) {
		el.onmouseover = function(e) {
			.....
		},
		el.onmouseout = function(e) {
			......
		},
		el.onclick = function(e) {
			.....
		}
	}
};

I have a globally scoped var updater (prototype v1.4.0) 
that is
initialized here:

updater = new Ajax.Updater(
    DIV,
    URL,
    {
        method:"get",
        evalScripts:false,
        onComplete: ApplyBehaviours
    });

My ApplyBehaviours() is simple, and I know it runs because I
can insert
an alert(someting) and get an alert.  The function is:

function ApplyBehaviours()
{
	Behaviour.apply();
}


The code is executed properly the first go-around.  The DIV
is only
populated by the Ajax.Updater, but it won't apply my rules
more than
once.

The process flow is:

therules = ......
Behaviour.register(therules)
new Ajax.Updater(....)  onComplete:  Behaviour.apply() 
--->> success
new Ajax.Updater(....)  onComplete:  Behaviour.apply() 
--->> failure

Has anyone dealt with this before?  Thanks in advance for
the help.
Great work on the library Ben and everyone else.

Dan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Behaviour Javascript Library"
group.
To post to this group, send email to behaviourgooglegroups.com
To unsubscribe from this group, send email to
behaviour-unsubscribegooglegroups.com
For more options, visit this group at http://group
s.google.com/group/behaviour
-~----------~----~----~----~------~----~------~--~---

Problem with partial DOM update and Behaviour.apply() (behaviour 1.1)
user name
2006-04-11 15:47:38
I have fixed the problem and found that Behaviour.apply()
actually was
working fine.  I had complicated things with some validation
flags that
were not being reset.

Thanks to anyone who had started looking into this.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Behaviour Javascript Library"
group.
To post to this group, send email to behaviourgooglegroups.com
To unsubscribe from this group, send email to
behaviour-unsubscribegooglegroups.com
For more options, visit this group at http://group
s.google.com/group/behaviour
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )