:: Forum >>

Studying ActiveWidgets Framework

Hi, Alex and AW fans

I spent lots of time on the source of ActiveWidgets recently. that is an amazing artwork and that is not any kind of flattering:).

when i moved on to the Active.System.HTML class, i got some doubts listed below:

1. what is the usage of .$owner and _parent variable in the init function body?

2. in line 188, while setClass method is invoked, is there neccessary to consider the parameter 'value' as a function? i do not think it make any sense since the value of class attribute of a HTML element is always String. who can tell me why?

thanks a lot!!

i like AW, it is the most neat and beautiful JS OO framework i never seen! thanks for you guys' contribution!
Tuesday, May 11, 2004
and here are more questions about the complex codes

still the HTML Class
in the method 'setClass', what is the meaning of the two lines below?

line 190: if (this.$index !== "") {return}
line 192: if (this.data) {return}
Tuesday, May 11, 2004
The ActiveWidgets framework is still in active development. Any object property which name starts with _ or $ is considered internal or 'private' and I would not recommend using them at all.

1). $owner and _parent properties refer to the owner/parent objects for template/static content respectively. There is not much reason why these are two different properties, I am planning some redesign here.

2). In many cases ActiveWidgets framework can accept a function instead of a static value. You can treat this feature as sort of data binding. The function will be called when the value is actually needed, normally on initial write or call to refresh method. In case of repeated template the function may return different values for different instances, including classes, style rules, attribute values and inner HTML content.

3). if (this.$index !== "") {return} - while the 'pull' behavior is fully implemented (see above), the more usual 'push' approach is still not fully there. So please ignore this for some time - I am working on it.

4). if (this.data) {return} - this is simply a bug and should be removed.
Alex (ActiveWidgets)
Tuesday, May 11, 2004

This topic is archived.

Back to support forum

Forum search