Hi,

No stupidity here - FlexJS is complex.

For the JavaScript side of FlexJS, createElement is the place where the
HTML element gets made that corresponds to the component being made. Most
of the time that is a <div> (see UIBase). Button uses it to make a
<button>. 

Each FlexJS UI component has a .element property which is the main HTML
element (e.g., a <div> or <input>).

Each FlexJS UI component has a .positioner property which is the HTML
element used to size and position the FlexJS component. Most of the time
.element and .positioner are the same. In some cases, .element might be a
<input> as it is the element of concern, but the .positioner might be a
<div> in which the .element is placed. I believe this is true for complex
components like Radio and ComboBox (not 100% certain - aging memory - but
there is at least one component that uses them separately). This lets you
add things to the .element (via the FlexJS addElement() function) and have
the component¹s x, y, width, and height affect the .positioner so every
HTML thing within the positioner is sized and moved together.

element.flexjs_wrapper allows the FlexJS JavaScript code to backwardly
reference the FlexJS class. Sometimes the JavaScript ³this² will be the
HTML element itself, so we can quickly get to the FlexJS class instance
using the .flexjs_wrapper. I can tell you it has come in handy sometimes.

I hope this helps.

Peter Ent
Adobe Systems

On 5/19/15, 10:31 AM, "Michael Schmalle" <teotigraphix...@gmail.com> wrote:

>Hi,
>
>I feel stupid for asking this and it's probably my dyslexic head(yeah I
>have it).
>
>Can someone explain exactly what is going on in createElement() in js?
>
>What is the positioner? Where does it come from?
>
>What is this doing exactly?
>
>this.element.flexjs_wrapper = this;
>
>I haven't worked with HTML and the DOM for a while and I am really trying
>to get the js side or else I am going to be no help.
>
>Mike

Reply via email to