On Sun, Aug 7, 2016 at 7:09 AM, Harbs <[email protected]> wrote:

> I also noticed that setting the className of a UIBase sets the class of
> the element, but setting the id does not set the element id. That does not
> seem right to me. Any reason to not add the id to the element as well?
>

In MXML, the "id" property is used as an object property name so that an
MXML element can be accessed as a property of the containing MXML component
instance. For example, if your component is defined as <VBox><Button
id="a"/></VBox> you can have multiple instances of that component and the
buttons can be accessed as instance1.a, instance2.a. In HTML, the "id"
property of an element allows you to access that element globally like
document.getElementById("a").  If the cross-compiled MXML set the "id"
property of the resulting DOM elements, it would prevent
document.getElementById() from working correctly in websites where you wish
to embed a FlexJS application.

Reply via email to