OK. That makes sense. (and yes, you understood me correctly) I do think that className should be assigned to the element though via MXML, and there should be an “element id” which should be set-able via MXML.
“id” is important if you want some external code to be able to address a piece of your FlexJS app. It’s also important for setting styles via CSS. On Aug 7, 2016, at 6:02 PM, Andy Dufilie <[email protected]> wrote: > 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.
