:: Forum >>

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
Yasdnil
Thursday, February 23, 2006
OK - taking a look at things under the Firefox debugger I can see that the model is stroed in the control objects as:

_panelHeadings1 : {array}

and the original defintion is still there :

_panelHeading : ""

So I can only suppose that to access the array I should be doing

x= this.getPanelProperty("headings1")

oe initialising my model differently ?
Yasdnil
Thursday, February 23, 2006

This topic is archived.


Back to support forum

Forum search