You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by zavr <za...@gmail.com> on 2015/03/21 18:16:10 UTC

MXML Selectors

Hey, I just thought it would be really cool if I could use mxml selectors,
e.g.
<s:VGroup id="rootGroup">
  <s:HGroup verticalAlign="middle">
    <s:Label text="Width:"/>
    <s:TextInput width="50" />
    <s:Label text="Height:"/>
    <s:TextInput width="50" />
    <s:Button label="Update" click="updateBtn_clickHandler(event)" />
  </s:HGroup>
  <s:Button label="Save as..."/>
</s:VGroup>

and then do something like rootGroup.find(".Hgroup > .Label") which returns
/all/ instances of type Label, or rootGroup.find(".Button['label'=Update]")
like attribute selector, etc. 
You get the idea!




--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/MXML-Selectors-tp45684.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: MXML Selectors

Posted by Alex Harui <ah...@adobe.com>.
Seems like you could write such a thing with out breaking anything, so
feel feel to try it.

The FlexJS code base is probably going to need something like this
eventually.

-Alex

On 3/21/15, 10:16 AM, "zavr" <za...@gmail.com> wrote:

>Hey, I just thought it would be really cool if I could use mxml selectors,
>e.g.
><s:VGroup id="rootGroup">
>  <s:HGroup verticalAlign="middle">
>    <s:Label text="Width:"/>
>    <s:TextInput width="50" />
>    <s:Label text="Height:"/>
>    <s:TextInput width="50" />
>    <s:Button label="Update" click="updateBtn_clickHandler(event)" />
>  </s:HGroup>
>  <s:Button label="Save as..."/>
></s:VGroup>
>
>and then do something like rootGroup.find(".Hgroup > .Label") which
>returns
>/all/ instances of type Label, or
>rootGroup.find(".Button['label'=Update]")
>like attribute selector, etc.
>You get the idea!
>
>
>
>
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/MXML-Selectors-tp4568
>4.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.