Custom Control Question
I have a control defined as follows
Then I have made a function for that object as follows
Then I pass an associative array as my parameter like this
The problem revolves around this line I believe but not sure how to solve it.
Problem: ?????
with(this.getTemplate(d))
Not sure how to get the template from another defined function. Anyone?
AW.HTML.userInfo = AW.System.Control.subclass();
AW.HTML.userInfo.create = function()
{
var obj = this.prototype;
obj.setTag("div");
obj.defineTemplate("myfield", new AW.HTML.SPAN);
with (obj.getTemplate("myfield"))
{
setClass("left-column","text");
setContent("");
}
}
Then I have made a function for that object as follows
AW.HTML.userInfo.prototype.update = function (theInfo)
{
for (var d in theInfo)
{
with(this.getTemplate(d))
{
setContent(theInfo[d]);
}
}
}
Then I pass an associative array as my parameter like this
var myUser = {'myfield':'test data'};
userInfo = new AW.HTML.userInfo;
userInfo.setId("mycontrol");
userInfo.update(myUser);
The problem revolves around this line I believe but not sure how to solve it.
Problem: ?????
with(this.getTemplate(d))
Not sure how to get the template from another defined function. Anyone?
Tony
January 17,