3.2.0

Beta 4 getTemplate bring forth new issue

I think beta 4 broke my custom control, within the control I have an update function that updates content to a bunch of AW.HTML.SPAN elements. Update code is as follows

[CODE]
obj.update = function (theInfo)
{
for (var d in theInfo)
{
eval('myobj = this.getTemplate("'+escape(d)+'")');
with(myobj) { setContent("html",theInfo[d]); }
}
}
[/CODE]

I see that getTemplate returns a clone now, so myobj differs from the original. But how do I get the new template (clone) to replace the existing one. Prior to beta 4 it worked perfectly, but I know it's the clone that is messing it up. Anyone have any ideas?
Tony
January 19,
Tony , I tryed the solution provided by Dmitry in your other post (10638)
and fails too, so I changed "this" with "obj" in the line:
this.getTemplate(d).setContent("html",theInfo[d]);
And works, maybe B4 new clone chage the meaning of "this" reference, you can try to do same change in your line:
eval('myobj = this.getTemplate("'+escape(d)+'")');
(Just an Idea) -- hopping it works...
Carlos
January 19,
Carlos, you have to be careful with obj. Keep in mind that obj is a reference to the control's prototype. So, while putting obj in there may seem to work, I suspect that doing so can have side effects if you have multiple instances of the control on the same page. Unfortunately I don't have b4 yet installed and I can't try this.
Dmitry
January 19,
Once again Carlos, you da man! That did it. Dmitry I am only using one instance for that object. So I am assuming that I would be ok, unless you know any other side effects.
Tony
January 19,

This topic is archived.

See also:


Back to support forum