flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Dufilie <andy.dufi...@gmail.com>
Subject Re: FlexJS MXML ids and classNames
Date Sun, 07 Aug 2016 15:02:31 GMT
On Sun, Aug 7, 2016 at 7:09 AM, Harbs <harbs.lists@gmail.com> 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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message