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("");
}
}
AW.HTML.userInfo.prototype.update = function (theInfo)
{
for (var d in theInfo)
{
with(this.getTemplate(d))
{
setContent(theInfo[d]);
}
}
}
var myUser = {'myfield':'test data'};
userInfo = new AW.HTML.userInfo;
userInfo.setId("mycontrol");
userInfo.update(myUser);
AW.HTML.userInfo.prototype.update = function (theInfo)
{
for (var d in theInfo)
{
eval('myobj = this.getTemplate("'+d+'")');
with(myobj)
{
setContent("html",theInfo[d]);
}
}
}
obj.update = function (theInfo)
{
for (var d in theInfo)
{
eval('myobj = this.getTemplate("'+d+'")');
with(myobj)
{
setContent("html",theInfo[d]);
}
}
}
AW.HTML.userInfo.prototype.update = function (theInfo)
{
for (var d in theInfo)
this.getTemplate(d).setContent(theInfo[d]);
}
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.getMyfieldTemplate())
{
setClass("left-column","text");
setContent("html", "<b>test</b>");
}
obj.setContent("html", function() {
return this.getMyfieldTemplate();
})
obj.update = function (theInfo)
{
for (var d in theInfo)
{
this.getTemplate(d).setContent("html",theInfo[d]);
}
}
}
var myUser = {'myfield':'test data'};
userInfo = new AW.HTML.userInfo;
userInfo.setId("mycontrol");
userInfo.update(myUser);
This topic is archived.