:: Forum >> Version 2 >>

object list

Alex,

When I create a new control, then create a new Template in that control, does the template object get added to the AW.object() list? Here is a quick example:

AW.UI.myControl AW.System.Control.subclass();
AW.UI.myControl.create = function()
{
  var 
obj this.prototype;
  
obj.defineTemplate("NewControl", new AW.HTML.DIV);
  
  
obj.setContent("html", function(){
    return 
this.getNewControlTemplate();
  });
}

var 
= new AW.UI.myControl;
x.setId('x');
 
My specific question is if I want to check for 'something' in the NewControl, do I have to get to it via getTemplate("NewControl") or can I also get to it via AW.object("x-NewControl")? I know this might look odd but I swear there was a reason I need to do this and I seemed to be getting mixed results. It seemed to work sometimes and not others.
Jim Hunter (www.FriendsOfAW.com)
Tuesday, February 14, 2006
No, template is not added to the global list because it is considered part of the control. However the AW.object("x-NewControl") should still work. The function will split the ID, find the control via global list and then call getTemplate() method with proper arguments, in short, it should return the template correctly.
Alex (ActiveWidgets)
Tuesday, February 14, 2006
Very cool, thanks.
Jim Hunter (www.FriendsOfAW.com)
Tuesday, February 14, 2006



This topic is archived.

Back to support forum

Forum search