Stange model behaviour - Help Please
I'm in the process of writing my own AW widget - and am making good headway - using the AW framework.
But I have hit a problem I cannot see my way out of :
I have defined a model in my control :
var models = {panel : {count: 0, headings: "" , items:"" }};
obj.defineModel("panel", models.panel);
and a template :
obj.defineTemplate("content", new AW.Sidebar.View);
and in the template setContent method I have:
var panelCount = this.getPanelProperty("count");
alert(panelCount) ;
var headings = this.getPanelProperty("headings");
alert(headings) ;
which when I set the model properties in my HTML code :
sidePane.setPanelHeadings(["test1","test2","test3","test4"]) ;
sidePane.setPanelCount(4) ;
the alerts in my template code return 4 (Correct) and nothing (Incorrect) ?
What am I doing wrong in trying to access model properties which are actually an array ? Can any one help ? Can any one give a correct example ?
Thanks in advance.
------------------------------------------------------------------
More at :
http://www.activewidgets.com/javascript.forum.12074.3/new-widget-how-to-start.html
But I have hit a problem I cannot see my way out of :
I have defined a model in my control :
var models = {panel : {count: 0, headings: "" , items:"" }};
obj.defineModel("panel", models.panel);
and a template :
obj.defineTemplate("content", new AW.Sidebar.View);
and in the template setContent method I have:
var panelCount = this.getPanelProperty("count");
alert(panelCount) ;
var headings = this.getPanelProperty("headings");
alert(headings) ;
which when I set the model properties in my HTML code :
sidePane.setPanelHeadings(["test1","test2","test3","test4"]) ;
sidePane.setPanelCount(4) ;
the alerts in my template code return 4 (Correct) and nothing (Incorrect) ?
What am I doing wrong in trying to access model properties which are actually an array ? Can any one help ? Can any one give a correct example ?
Thanks in advance.
------------------------------------------------------------------
More at :
http://www.activewidgets.com/javascript.forum.12074.3/new-widget-how-to-start.html
Yasdnil
February 23,