You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Harbs <ha...@gmail.com> on 2017/10/30 17:47:37 UTC

Re: [GitHub] justinmclean commented on issue #60: Image not removed when src set to null

This does raise a good question:

Should we be adding MXML meta tags for all supported events? It seems like a desirable thing to have, and there are currently very few event tags. I’m not clear on whether the meta-tags effect the end result of code size.

Harbs

> On Oct 30, 2017, at 7:38 PM, GitBox <gi...@apache.org> wrote:
> 
> justinmclean commented on issue #60: Image not removed when src set to null
> URL: https://github.com/apache/royale-asjs/issues/60#issuecomment-340524197
> 
> 
>   This code fails to compile:
>   ```
>   <?xml version="1.0" encoding="utf-8"?>
>   <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                   xmlns:js="library://ns.apache.org/royale/basic">
> 
>       <fx:Script><![CDATA[
>           import org.apache.flex.events.IEventDispatcher;
> 
>           public function blankimage():void {
>               image.visible = false;
>               image.src =  "https://www.apache.org/foundation/press/kit/poweredBy/Apache_PoweredBy.png";
>           }
>           public function showImage():void {
>               image.visible = true;
>           }
>           ]]></fx:Script>
> 
>       <js:valuesImpl>
>           <js:SimpleCSSValuesImpl/>
>       </js:valuesImpl>
> 
>       <js:initialView>
> 
>           <js:View>
>               <js:Container id="startPage" visible="true" width="100%">
>                   <js:beads>
>                       <js:VerticalLayout />
>                   </js:beads>
>                   <js:Image id="image" src="https://www.apache.org/foundation/press/kit/asf_logo_url.png" width="50%" height="50%" layoutNeeded="showImage()" />
>                   <js:TextButton text="Blank" click="blankimage()" />
>               </js:Container>
>           </js:View>
>       </js:initialView>
> 
>   </js:Application>
>   ```
> 
>   With this error:
>   ```
>   /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26): col: 130 This attribute is unexpected. It will be ignored.
> 
>                   <js:Image id="image" src="https://www.apache.org/foundation/press/kit/asf_logo_url.png" width="50%" height="50%" layoutNeeded="showImage()" />
>   ```
> 
>   I assume the only way to do this would be to add a hard coded event listener manually like so?
> 
>   ```
>       <fx:Script><![CDATA[        
>           public function blankimage():void {
>               image.visible = false;
>               image.src =  "https://www.apache.org/foundation/press/kit/poweredBy/Apache_PoweredBy.png";
>               image.addEventListener("layoutNeeded", showImage);
>           }
> 
>           public function showImage(event:Event):void {
>               image.visible = true;
>           }
>           ]]></fx:Script>
>   ```
> 
> 
> ----------------------------------------------------------------
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on GitHub and use the
> URL above to go to the specific comment.
> 
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
> 
> 
> With regards,
> Apache Git Services


Re: [GitHub] justinmclean commented on issue #60: Image not removed when src set to null

Posted by Harbs <ha...@gmail.com>.
Good points.

> One issue to consider are whether a container of beads should be have
> metadata about the events dispatched by its beads since the changing of
> beads could make that metadata incorrect.  IMO, this has been a problem in
> Flex forever.  Maybe a smarter IDE could figure out what beads are
> currently in play and aggregate allowable events from those beads'
> metadata someday.

Hmm. Not a simple problem. One approach we can take is to add metadata to the component and include documentation on which beads are required for the event to fire.

Of course this only takes care of more-or-less standard beads. Optional beads that are generally not used would need another mechanism to specify event handlers in MXML (if that would be supported).

Considering the “smarter IDE approach”, it seems like there’s two problems:
1. The compiler needs to know that the attributes are OK. Currently, the compiler will complain if you use an unrecognized tag.
2. There’s lots of ways to add beads, and it’s hard to know if a specific bead is actually added. They can be added using CSS, AS code and MXML. Dynamically following that flow in tooling seems like a *really* hard problem.

Another idea would be to allow specifying event handlers in a format something like this:
<js:FooComponent id=“foo”>
<js:events>
<js:EventDescriptor type”layoutNeeded” handler=“handleLayoutNeeded()”/>
</js:events>
</js:FooComponent>

I’m kind of liking this idea as it follows the pattern we currently have for beads and styles. EventDescriptor could be subclassed to have classes of events which could offer code completion for the available event types. There would not be enforcement that the events would actually be dispatched, but I think it would be helpful and would allow users to specify random event handlers declaratively.

> Another issue to consider is cross-platform.  A component may not be able
> to dispatch the events listed in metadata on all platforms.

It seems to me that metadata on cross-platform components should always be cross-platform. If there are platform-specific events, they should not be included or there should be a platform-specific component. We’ve already solved the problem with mouse events by renaming the event strings in the compiler depending on the target. (i.e. “doubleClick” in MXML becomes “dblclick” automatically for JS output). I think Mouse events are an exception, but if there are any other events that fit this exception, they should be handled the same way.

> On Oct 30, 2017, at 8:41 PM, Alex Harui <ah...@adobe.com.INVALID> wrote:
> 
> Some Metadata is kept in the output, but events probably aren't.
> 
> One issue to consider are whether a container of beads should be have
> metadata about the events dispatched by its beads since the changing of
> beads could make that metadata incorrect.  IMO, this has been a problem in
> Flex forever.  Maybe a smarter IDE could figure out what beads are
> currently in play and aggregate allowable events from those beads'
> metadata someday.
> 
> Another issue to consider is cross-platform.  A component may not be able
> to dispatch the events listed in metadata on all platforms.
> 
> Also consider that on JS, events probably have to be propagated from the
> wrapped element to the strand so there is cost there.
> 
> It is hopefully easy enough for anyone who wants to get an event that
> isn't already in metadata, to subclass, add the metadata and any wiring.
> 
> My 2 cents,
> -Alex
> 
> On 10/30/17, 11:24 AM, "Harbs" <harbs.lists@gmail.com <ma...@gmail.com>> wrote:
> 
>> I’m not talking about adding events. I’m talking about adding metadata
>> for *existing events* so they could be addressed in MXML.
>> 
>> 
>>> On Oct 30, 2017, at 8:18 PM, Piotr Zarzycki <pi...@gmail.com>
>>> wrote:
>>> 
>>> If you decide to add event that's fine with me. :) It is just the
>>> matter of
>>> thinking about those Basic components from my sight. I have started to
>>> look
>>> at them as something which should be closer to HTML than to the old Flex
>>> world. Rest of the features should be provided by beads - if it is
>>> possible
>>> or by Express.
>>> 
>>> The exception could be and MDL from that which I would like to extend,
>>> but
>>> here I can think about those components as they are Express right now.
>>> 
>>> Piotr
>>> 
>>> 
>>> 2017-10-30 19:07 GMT+01:00 Harbs <ha...@gmail.com>:
>>> 
>>>> Why? Unless it adds overhead, it seems to me like any event that can be
>>>> added using addEventListener() should be addressable using MXML.
>>>> 
>>>> I’m just not sure from a technical perspective whether the MXML meta
>>>> tags
>>>> add overhead if not used.
>>>> 
>>>>> On Oct 30, 2017, at 8:02 PM, Piotr Zarzycki
>>>>> <pi...@gmail.com>
>>>> wrote:
>>>>> 
>>>>> Hi Harbs,
>>>>> 
>>>>> Some time ago there were discussion on Flex Dev which makes me realize
>>>> that
>>>>> we should add event tags as long as they are reflecting some native
>>>>> HTML
>>>>> api, unless we are in express. For example we are using in many places
>>>>> "change" event which is I believe quite common in JS world, but I
>>>>> would
>>>>> avoid any additional custom one. In the other world Let's answer to
>>>>> the
>>>>> question in following case - Does "img" in HTML world have "load"
>>>>> event ?
>>>>> 
>>>>> Piotr
>>>>> 
>>>>> 
>>>>> 2017-10-30 18:47 GMT+01:00 Harbs <ha...@gmail.com>:
>>>>> 
>>>>>> This does raise a good question:
>>>>>> 
>>>>>> Should we be adding MXML meta tags for all supported events? It seems
>>>> like
>>>>>> a desirable thing to have, and there are currently very few event
>>>>>> tags.
>>>> I’m
>>>>>> not clear on whether the meta-tags effect the end result of code
>>>>>> size.
>>>>>> 
>>>>>> Harbs
>>>>>> 
>>>>>>> On Oct 30, 2017, at 7:38 PM, GitBox <gi...@apache.org> wrote:
>>>>>>> 
>>>>>>> justinmclean commented on issue #60: Image not removed when src set
>>>>>>> to
>>>>>> null
>>>>>>> URL: 
>>>>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith>
>>>>>>> ub.com <http://ub.com/>%2Fapache%2Froyale-asjs%2Fissues%2F60%23&data=02%7C01%7C%7Cd040
>>>>>>> 5ef4adc6485ba55208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7
>>>>>>> C0%7C636449847130199355&sdata=GJ5cQmWUXSJyuYIcs2dn5UU%2BGtWVqy17xFbif
>>>>>>> 9Gknpc%3D&reserved=0
>>>>>> issuecomment-340524197
>>>>>>> 
>>>>>>> 
>>>>>>> This code fails to compile:
>>>>>>> ```
>>>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>>>> <js:Application
>>>>>>> xmlns:fx="https://na01.safelinks.protection.outlook.com/?url=http%3A% <https://na01.safelinks.protection.outlook.com/?url=http%3A%>
>>>>>>> 2F%2Fns.adobe.com <http://2fns.adobe.com/>%2Fmxml%2F2009&data=02%7C01%7C%7Cd0405ef4adc6485ba55
>>>>>>> 208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364498471
>>>>>>> 30355609&sdata=h2%2BZE%2FtC5p0ZVuay%2B01WvZSF%2BSc7%2BUbqLFKdzAe4%2Bn
>>>>>>> o%3D&reserved=0"
>>>>>>>                xmlns:js="library://ns.apache.org/royale/basic <library://ns.apache.org/royale/basic>">
>>>>>>> 
>>>>>>>    <fx:Script><![CDATA[
>>>>>>>        import org.apache.flex.events.IEventDispatcher;
>>>>>>> 
>>>>>>>        public function blankimage():void {
>>>>>>>            image.visible = false;
>>>>>>>            image.src =
>>>>>>> "https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww>
>>>>>>> .apache.org <http://apache.org/>%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07%7Cf
>>>>>>> a7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=pn
>>>>>>> iuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>>> foundation/press/kit/
>>>>>> poweredBy/Apache_PoweredBy.png";
>>>>>>>        }
>>>>>>>        public function showImage():void {
>>>>>>>            image.visible = true;
>>>>>>>        }
>>>>>>>        ]]></fx:Script>
>>>>>>> 
>>>>>>>    <js:valuesImpl>
>>>>>>>        <js:SimpleCSSValuesImpl/>
>>>>>>>    </js:valuesImpl>
>>>>>>> 
>>>>>>>    <js:initialView>
>>>>>>> 
>>>>>>>        <js:View>
>>>>>>>            <js:Container id="startPage" visible="true"
>>>>>>> width="100%">
>>>>>>>                <js:beads>
>>>>>>>                    <js:VerticalLayout />
>>>>>>>                </js:beads>
>>>>>>>                <js:Image id="image"
>>>>>>> src="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2>
>>>>>>> Fwww.apache.org <http://fwww.apache.org/>%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07
>>>>>>> %7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdat
>>>>>>> a=pniuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>>>>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>>>>>> layoutNeeded="showImage()" />
>>>>>>>                <js:TextButton text="Blank" click="blankimage()" />
>>>>>>>            </js:Container>
>>>>>>>        </js:View>
>>>>>>>    </js:initialView>
>>>>>>> 
>>>>>>> </js:Application>
>>>>>>> ```
>>>>>>> 
>>>>>>> With this error:
>>>>>>> ```
>>>>>>> /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26):
>>>>>> col: 130 This attribute is unexpected. It will be ignored.
>>>>>>> 
>>>>>>>                <js:Image id="image"
>>>>>>> src="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2>
>>>>>>> Fwww.apache.org <http://fwww.apache.org/>%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07
>>>>>>> %7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdat
>>>>>>> a=pniuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>>>>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>>>>>> layoutNeeded="showImage()" />
>>>>>>> ```
>>>>>>> 
>>>>>>> I assume the only way to do this would be to add a hard coded event
>>>>>> listener manually like so?
>>>>>>> 
>>>>>>> ```
>>>>>>>    <fx:Script><![CDATA[
>>>>>>>        public function blankimage():void {
>>>>>>>            image.visible = false;
>>>>>>>            image.src =
>>>>>>> "https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww>
>>>>>>> .apache.org <http://apache.org/>%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07%7Cf
>>>>>>> a7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=pn
>>>>>>> iuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>>> foundation/press/kit/
>>>>>> poweredBy/Apache_PoweredBy.png";
>>>>>>>            image.addEventListener("layoutNeeded", showImage);
>>>>>>>        }
>>>>>>> 
>>>>>>>        public function showImage(event:Event):void {
>>>>>>>            image.visible = true;
>>>>>>>        }
>>>>>>>        ]]></fx:Script>
>>>>>>> ```
>>>>>>> 
>>>>>>> 
>>>>>>> ----------------------------------------------------------------
>>>>>>> This is an automated message from the Apache Git Service.
>>>>>>> To respond to the message, please log on GitHub and use the
>>>>>>> URL above to go to the specific comment.
>>>>>>> 
>>>>>>> For queries about this service, please contact Infrastructure at:
>>>>>>> users@infra.apache.org <ma...@infra.apache.org>
>>>>>>> 
>>>>>>> 
>>>>>>> With regards,
>>>>>>> Apache Git Services
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> 
>>>>> Piotr Zarzycki
>>>>> 
>>>>> mobile: +48 880 859 557
>>>>> skype: zarzycki10
>>>>> 
>>>>> LinkedIn: 
>>>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.lin <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.lin>
>>>>> kedin.com <http://kedin.com/>%2Fpiotrzarzycki&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc
>>>>> 38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&s
>>>>> data=Mhs%2F8uCEal%2F%2ByaWFrAPHoahv3fp7MaaCQ7ezLraU5WQ%3D&reserved=0
>>>>> 
>>>>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpl.li <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpl.li>
>>>>> nkedin.com <http://nkedin.com/>%2Fin%2Fpiotr-zarzycki-92a53552&data=02%7C01%7C%7Cd0405ef4adc
>>>>> 6485ba55208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364
>>>>> 49847130355609&sdata=K%2FVEqa3kVpSXeOppqc9JLQKnxRmGNI3bZNQ%2FHqEAKNo%3D
>>>>> &reserved=0>
>>>>> 
>>>>> GitHub: 
>>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub>
>>>>> .com%2Fpiotrzarzycki21&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b
>>>>> 07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdat
>>>>> a=mi12zf18eKrbGi30qfgZgGD9RRoPGGL%2BwAo1unRqnYc%3D&reserved=0
>>>> 
>>>> 
>>> 
>>> 
>>> -- 
>>> 
>>> Piotr Zarzycki
>>> 
>>> mobile: +48 880 859 557
>>> skype: zarzycki10
>>> 
>>> LinkedIn: 
>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linke <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linke>
>>> din.com <http://din.com/>%2Fpiotrzarzycki&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b0
>>> 7%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=M
>>> hs%2F8uCEal%2F%2ByaWFrAPHoahv3fp7MaaCQ7ezLraU5WQ%3D&reserved=0
>>> 
>>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpl.link <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpl.link>
>>> edin.com <http://edin.com/>%2Fin%2Fpiotr-zarzycki-92a53552&data=02%7C01%7C%7Cd0405ef4adc6485
>>> ba55208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364498471
>>> 30355609&sdata=K%2FVEqa3kVpSXeOppqc9JLQKnxRmGNI3bZNQ%2FHqEAKNo%3D&reserve
>>> d=0>
>>> 
>>> GitHub: 
>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.c <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.c>
>>> om%2Fpiotrzarzycki21&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07%7
>>> Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=mi12
>>> zf18eKrbGi30qfgZgGD9RRoPGGL%2BwAo1unRqnYc%3D&reserved=0


Re: [GitHub] justinmclean commented on issue #60: Image not removed when src set to null

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Some Metadata is kept in the output, but events probably aren't.

One issue to consider are whether a container of beads should be have
metadata about the events dispatched by its beads since the changing of
beads could make that metadata incorrect.  IMO, this has been a problem in
Flex forever.  Maybe a smarter IDE could figure out what beads are
currently in play and aggregate allowable events from those beads'
metadata someday.

Another issue to consider is cross-platform.  A component may not be able
to dispatch the events listed in metadata on all platforms.

Also consider that on JS, events probably have to be propagated from the
wrapped element to the strand so there is cost there.

It is hopefully easy enough for anyone who wants to get an event that
isn't already in metadata, to subclass, add the metadata and any wiring.

My 2 cents,
-Alex

On 10/30/17, 11:24 AM, "Harbs" <ha...@gmail.com> wrote:

>I’m not talking about adding events. I’m talking about adding metadata
>for *existing events* so they could be addressed in MXML.
>
>
>> On Oct 30, 2017, at 8:18 PM, Piotr Zarzycki <pi...@gmail.com>
>>wrote:
>> 
>> If you decide to add event that's fine with me. :) It is just the
>>matter of
>> thinking about those Basic components from my sight. I have started to
>>look
>> at them as something which should be closer to HTML than to the old Flex
>> world. Rest of the features should be provided by beads - if it is
>>possible
>> or by Express.
>> 
>> The exception could be and MDL from that which I would like to extend,
>>but
>> here I can think about those components as they are Express right now.
>> 
>> Piotr
>> 
>> 
>> 2017-10-30 19:07 GMT+01:00 Harbs <ha...@gmail.com>:
>> 
>>> Why? Unless it adds overhead, it seems to me like any event that can be
>>> added using addEventListener() should be addressable using MXML.
>>> 
>>> I’m just not sure from a technical perspective whether the MXML meta
>>>tags
>>> add overhead if not used.
>>> 
>>>> On Oct 30, 2017, at 8:02 PM, Piotr Zarzycki
>>>><pi...@gmail.com>
>>> wrote:
>>>> 
>>>> Hi Harbs,
>>>> 
>>>> Some time ago there were discussion on Flex Dev which makes me realize
>>> that
>>>> we should add event tags as long as they are reflecting some native
>>>>HTML
>>>> api, unless we are in express. For example we are using in many places
>>>> "change" event which is I believe quite common in JS world, but I
>>>>would
>>>> avoid any additional custom one. In the other world Let's answer to
>>>>the
>>>> question in following case - Does "img" in HTML world have "load"
>>>>event ?
>>>> 
>>>> Piotr
>>>> 
>>>> 
>>>> 2017-10-30 18:47 GMT+01:00 Harbs <ha...@gmail.com>:
>>>> 
>>>>> This does raise a good question:
>>>>> 
>>>>> Should we be adding MXML meta tags for all supported events? It seems
>>> like
>>>>> a desirable thing to have, and there are currently very few event
>>>>>tags.
>>> I’m
>>>>> not clear on whether the meta-tags effect the end result of code
>>>>>size.
>>>>> 
>>>>> Harbs
>>>>> 
>>>>>> On Oct 30, 2017, at 7:38 PM, GitBox <gi...@apache.org> wrote:
>>>>>> 
>>>>>> justinmclean commented on issue #60: Image not removed when src set
>>>>>>to
>>>>> null
>>>>>> URL: 
>>>>>>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
>>>>>>ub.com%2Fapache%2Froyale-asjs%2Fissues%2F60%23&data=02%7C01%7C%7Cd040
>>>>>>5ef4adc6485ba55208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7
>>>>>>C0%7C636449847130199355&sdata=GJ5cQmWUXSJyuYIcs2dn5UU%2BGtWVqy17xFbif
>>>>>>9Gknpc%3D&reserved=0
>>>>> issuecomment-340524197
>>>>>> 
>>>>>> 
>>>>>> This code fails to compile:
>>>>>> ```
>>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>>> <js:Application
>>>>>>xmlns:fx="https://na01.safelinks.protection.outlook.com/?url=http%3A%
>>>>>>2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7C%7Cd0405ef4adc6485ba55
>>>>>>208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364498471
>>>>>>30355609&sdata=h2%2BZE%2FtC5p0ZVuay%2B01WvZSF%2BSc7%2BUbqLFKdzAe4%2Bn
>>>>>>o%3D&reserved=0"
>>>>>>                 xmlns:js="library://ns.apache.org/royale/basic">
>>>>>> 
>>>>>>     <fx:Script><![CDATA[
>>>>>>         import org.apache.flex.events.IEventDispatcher;
>>>>>> 
>>>>>>         public function blankimage():void {
>>>>>>             image.visible = false;
>>>>>>             image.src =
>>>>>>"https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
>>>>>>.apache.org%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07%7Cf
>>>>>>a7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=pn
>>>>>>iuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>> foundation/press/kit/
>>>>> poweredBy/Apache_PoweredBy.png";
>>>>>>         }
>>>>>>         public function showImage():void {
>>>>>>             image.visible = true;
>>>>>>         }
>>>>>>         ]]></fx:Script>
>>>>>> 
>>>>>>     <js:valuesImpl>
>>>>>>         <js:SimpleCSSValuesImpl/>
>>>>>>     </js:valuesImpl>
>>>>>> 
>>>>>>     <js:initialView>
>>>>>> 
>>>>>>         <js:View>
>>>>>>             <js:Container id="startPage" visible="true"
>>>>>>width="100%">
>>>>>>                 <js:beads>
>>>>>>                     <js:VerticalLayout />
>>>>>>                 </js:beads>
>>>>>>                 <js:Image id="image"
>>>>>>src="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2
>>>>>>Fwww.apache.org%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07
>>>>>>%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdat
>>>>>>a=pniuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>>>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>>>>> layoutNeeded="showImage()" />
>>>>>>                 <js:TextButton text="Blank" click="blankimage()" />
>>>>>>             </js:Container>
>>>>>>         </js:View>
>>>>>>     </js:initialView>
>>>>>> 
>>>>>> </js:Application>
>>>>>> ```
>>>>>> 
>>>>>> With this error:
>>>>>> ```
>>>>>> /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26):
>>>>> col: 130 This attribute is unexpected. It will be ignored.
>>>>>> 
>>>>>>                 <js:Image id="image"
>>>>>>src="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2
>>>>>>Fwww.apache.org%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07
>>>>>>%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdat
>>>>>>a=pniuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>>>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>>>>> layoutNeeded="showImage()" />
>>>>>> ```
>>>>>> 
>>>>>> I assume the only way to do this would be to add a hard coded event
>>>>> listener manually like so?
>>>>>> 
>>>>>> ```
>>>>>>     <fx:Script><![CDATA[
>>>>>>         public function blankimage():void {
>>>>>>             image.visible = false;
>>>>>>             image.src =
>>>>>>"https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
>>>>>>.apache.org%2F&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07%7Cf
>>>>>>a7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=pn
>>>>>>iuBoujFMWxq1MjO1rmnLPHgMC6CzFPHl2HhXjOwhk%3D&reserved=0
>>> foundation/press/kit/
>>>>> poweredBy/Apache_PoweredBy.png";
>>>>>>             image.addEventListener("layoutNeeded", showImage);
>>>>>>         }
>>>>>> 
>>>>>>         public function showImage(event:Event):void {
>>>>>>             image.visible = true;
>>>>>>         }
>>>>>>         ]]></fx:Script>
>>>>>> ```
>>>>>> 
>>>>>> 
>>>>>> ----------------------------------------------------------------
>>>>>> This is an automated message from the Apache Git Service.
>>>>>> To respond to the message, please log on GitHub and use the
>>>>>> URL above to go to the specific comment.
>>>>>> 
>>>>>> For queries about this service, please contact Infrastructure at:
>>>>>> users@infra.apache.org
>>>>>> 
>>>>>> 
>>>>>> With regards,
>>>>>> Apache Git Services
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> --
>>>> 
>>>> Piotr Zarzycki
>>>> 
>>>> mobile: +48 880 859 557
>>>> skype: zarzycki10
>>>> 
>>>> LinkedIn: 
>>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.lin
>>>>kedin.com%2Fpiotrzarzycki&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc
>>>>38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&s
>>>>data=Mhs%2F8uCEal%2F%2ByaWFrAPHoahv3fp7MaaCQ7ezLraU5WQ%3D&reserved=0
>>>> 
>>>><https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpl.li
>>>>nkedin.com%2Fin%2Fpiotr-zarzycki-92a53552&data=02%7C01%7C%7Cd0405ef4adc
>>>>6485ba55208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364
>>>>49847130355609&sdata=K%2FVEqa3kVpSXeOppqc9JLQKnxRmGNI3bZNQ%2FHqEAKNo%3D
>>>>&reserved=0>
>>>> 
>>>> GitHub: 
>>>>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub
>>>>.com%2Fpiotrzarzycki21&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b
>>>>07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdat
>>>>a=mi12zf18eKrbGi30qfgZgGD9RRoPGGL%2BwAo1unRqnYc%3D&reserved=0
>>> 
>>> 
>> 
>> 
>> -- 
>> 
>> Piotr Zarzycki
>> 
>> mobile: +48 880 859 557
>> skype: zarzycki10
>> 
>> LinkedIn: 
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linke
>>din.com%2Fpiotrzarzycki&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b0
>>7%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=M
>>hs%2F8uCEal%2F%2ByaWFrAPHoahv3fp7MaaCQ7ezLraU5WQ%3D&reserved=0
>> 
>><https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpl.link
>>edin.com%2Fin%2Fpiotr-zarzycki-92a53552&data=02%7C01%7C%7Cd0405ef4adc6485
>>ba55208d51fc38b07%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364498471
>>30355609&sdata=K%2FVEqa3kVpSXeOppqc9JLQKnxRmGNI3bZNQ%2FHqEAKNo%3D&reserve
>>d=0>
>> 
>> GitHub: 
>>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.c
>>om%2Fpiotrzarzycki21&data=02%7C01%7C%7Cd0405ef4adc6485ba55208d51fc38b07%7
>>Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636449847130355609&sdata=mi12
>>zf18eKrbGi30qfgZgGD9RRoPGGL%2BwAo1unRqnYc%3D&reserved=0
>


Re: [GitHub] justinmclean commented on issue #60: Image not removed when src set to null

Posted by Harbs <ha...@gmail.com>.
I’m not talking about adding events. I’m talking about adding metadata for *existing events* so they could be addressed in MXML.


> On Oct 30, 2017, at 8:18 PM, Piotr Zarzycki <pi...@gmail.com> wrote:
> 
> If you decide to add event that's fine with me. :) It is just the matter of
> thinking about those Basic components from my sight. I have started to look
> at them as something which should be closer to HTML than to the old Flex
> world. Rest of the features should be provided by beads - if it is possible
> or by Express.
> 
> The exception could be and MDL from that which I would like to extend, but
> here I can think about those components as they are Express right now.
> 
> Piotr
> 
> 
> 2017-10-30 19:07 GMT+01:00 Harbs <ha...@gmail.com>:
> 
>> Why? Unless it adds overhead, it seems to me like any event that can be
>> added using addEventListener() should be addressable using MXML.
>> 
>> I’m just not sure from a technical perspective whether the MXML meta tags
>> add overhead if not used.
>> 
>>> On Oct 30, 2017, at 8:02 PM, Piotr Zarzycki <pi...@gmail.com>
>> wrote:
>>> 
>>> Hi Harbs,
>>> 
>>> Some time ago there were discussion on Flex Dev which makes me realize
>> that
>>> we should add event tags as long as they are reflecting some native HTML
>>> api, unless we are in express. For example we are using in many places
>>> "change" event which is I believe quite common in JS world, but I would
>>> avoid any additional custom one. In the other world Let's answer to the
>>> question in following case - Does "img" in HTML world have "load" event ?
>>> 
>>> Piotr
>>> 
>>> 
>>> 2017-10-30 18:47 GMT+01:00 Harbs <ha...@gmail.com>:
>>> 
>>>> This does raise a good question:
>>>> 
>>>> Should we be adding MXML meta tags for all supported events? It seems
>> like
>>>> a desirable thing to have, and there are currently very few event tags.
>> I’m
>>>> not clear on whether the meta-tags effect the end result of code size.
>>>> 
>>>> Harbs
>>>> 
>>>>> On Oct 30, 2017, at 7:38 PM, GitBox <gi...@apache.org> wrote:
>>>>> 
>>>>> justinmclean commented on issue #60: Image not removed when src set to
>>>> null
>>>>> URL: https://github.com/apache/royale-asjs/issues/60#
>>>> issuecomment-340524197
>>>>> 
>>>>> 
>>>>> This code fails to compile:
>>>>> ```
>>>>> <?xml version="1.0" encoding="utf-8"?>
>>>>> <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>>>                 xmlns:js="library://ns.apache.org/royale/basic">
>>>>> 
>>>>>     <fx:Script><![CDATA[
>>>>>         import org.apache.flex.events.IEventDispatcher;
>>>>> 
>>>>>         public function blankimage():void {
>>>>>             image.visible = false;
>>>>>             image.src =  "https://www.apache.org/
>> foundation/press/kit/
>>>> poweredBy/Apache_PoweredBy.png";
>>>>>         }
>>>>>         public function showImage():void {
>>>>>             image.visible = true;
>>>>>         }
>>>>>         ]]></fx:Script>
>>>>> 
>>>>>     <js:valuesImpl>
>>>>>         <js:SimpleCSSValuesImpl/>
>>>>>     </js:valuesImpl>
>>>>> 
>>>>>     <js:initialView>
>>>>> 
>>>>>         <js:View>
>>>>>             <js:Container id="startPage" visible="true" width="100%">
>>>>>                 <js:beads>
>>>>>                     <js:VerticalLayout />
>>>>>                 </js:beads>
>>>>>                 <js:Image id="image" src="https://www.apache.org/
>>>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>>>> layoutNeeded="showImage()" />
>>>>>                 <js:TextButton text="Blank" click="blankimage()" />
>>>>>             </js:Container>
>>>>>         </js:View>
>>>>>     </js:initialView>
>>>>> 
>>>>> </js:Application>
>>>>> ```
>>>>> 
>>>>> With this error:
>>>>> ```
>>>>> /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26):
>>>> col: 130 This attribute is unexpected. It will be ignored.
>>>>> 
>>>>>                 <js:Image id="image" src="https://www.apache.org/
>>>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>>>> layoutNeeded="showImage()" />
>>>>> ```
>>>>> 
>>>>> I assume the only way to do this would be to add a hard coded event
>>>> listener manually like so?
>>>>> 
>>>>> ```
>>>>>     <fx:Script><![CDATA[
>>>>>         public function blankimage():void {
>>>>>             image.visible = false;
>>>>>             image.src =  "https://www.apache.org/
>> foundation/press/kit/
>>>> poweredBy/Apache_PoweredBy.png";
>>>>>             image.addEventListener("layoutNeeded", showImage);
>>>>>         }
>>>>> 
>>>>>         public function showImage(event:Event):void {
>>>>>             image.visible = true;
>>>>>         }
>>>>>         ]]></fx:Script>
>>>>> ```
>>>>> 
>>>>> 
>>>>> ----------------------------------------------------------------
>>>>> This is an automated message from the Apache Git Service.
>>>>> To respond to the message, please log on GitHub and use the
>>>>> URL above to go to the specific comment.
>>>>> 
>>>>> For queries about this service, please contact Infrastructure at:
>>>>> users@infra.apache.org
>>>>> 
>>>>> 
>>>>> With regards,
>>>>> Apache Git Services
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> 
>>> Piotr Zarzycki
>>> 
>>> mobile: +48 880 859 557
>>> skype: zarzycki10
>>> 
>>> LinkedIn: http://www.linkedin.com/piotrzarzycki
>>> <https://pl.linkedin.com/in/piotr-zarzycki-92a53552>
>>> 
>>> GitHub: https://github.com/piotrzarzycki21
>> 
>> 
> 
> 
> -- 
> 
> Piotr Zarzycki
> 
> mobile: +48 880 859 557
> skype: zarzycki10
> 
> LinkedIn: http://www.linkedin.com/piotrzarzycki
> <https://pl.linkedin.com/in/piotr-zarzycki-92a53552>
> 
> GitHub: https://github.com/piotrzarzycki21


Re: [GitHub] justinmclean commented on issue #60: Image not removed when src set to null

Posted by Piotr Zarzycki <pi...@gmail.com>.
If you decide to add event that's fine with me. :) It is just the matter of
thinking about those Basic components from my sight. I have started to look
at them as something which should be closer to HTML than to the old Flex
world. Rest of the features should be provided by beads - if it is possible
or by Express.

The exception could be and MDL from that which I would like to extend, but
here I can think about those components as they are Express right now.

Piotr


2017-10-30 19:07 GMT+01:00 Harbs <ha...@gmail.com>:

> Why? Unless it adds overhead, it seems to me like any event that can be
> added using addEventListener() should be addressable using MXML.
>
> I’m just not sure from a technical perspective whether the MXML meta tags
> add overhead if not used.
>
> > On Oct 30, 2017, at 8:02 PM, Piotr Zarzycki <pi...@gmail.com>
> wrote:
> >
> > Hi Harbs,
> >
> > Some time ago there were discussion on Flex Dev which makes me realize
> that
> > we should add event tags as long as they are reflecting some native HTML
> > api, unless we are in express. For example we are using in many places
> > "change" event which is I believe quite common in JS world, but I would
> > avoid any additional custom one. In the other world Let's answer to the
> > question in following case - Does "img" in HTML world have "load" event ?
> >
> > Piotr
> >
> >
> > 2017-10-30 18:47 GMT+01:00 Harbs <ha...@gmail.com>:
> >
> >> This does raise a good question:
> >>
> >> Should we be adding MXML meta tags for all supported events? It seems
> like
> >> a desirable thing to have, and there are currently very few event tags.
> I’m
> >> not clear on whether the meta-tags effect the end result of code size.
> >>
> >> Harbs
> >>
> >>> On Oct 30, 2017, at 7:38 PM, GitBox <gi...@apache.org> wrote:
> >>>
> >>> justinmclean commented on issue #60: Image not removed when src set to
> >> null
> >>> URL: https://github.com/apache/royale-asjs/issues/60#
> >> issuecomment-340524197
> >>>
> >>>
> >>>  This code fails to compile:
> >>>  ```
> >>>  <?xml version="1.0" encoding="utf-8"?>
> >>>  <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
> >>>                  xmlns:js="library://ns.apache.org/royale/basic">
> >>>
> >>>      <fx:Script><![CDATA[
> >>>          import org.apache.flex.events.IEventDispatcher;
> >>>
> >>>          public function blankimage():void {
> >>>              image.visible = false;
> >>>              image.src =  "https://www.apache.org/
> foundation/press/kit/
> >> poweredBy/Apache_PoweredBy.png";
> >>>          }
> >>>          public function showImage():void {
> >>>              image.visible = true;
> >>>          }
> >>>          ]]></fx:Script>
> >>>
> >>>      <js:valuesImpl>
> >>>          <js:SimpleCSSValuesImpl/>
> >>>      </js:valuesImpl>
> >>>
> >>>      <js:initialView>
> >>>
> >>>          <js:View>
> >>>              <js:Container id="startPage" visible="true" width="100%">
> >>>                  <js:beads>
> >>>                      <js:VerticalLayout />
> >>>                  </js:beads>
> >>>                  <js:Image id="image" src="https://www.apache.org/
> >> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
> >> layoutNeeded="showImage()" />
> >>>                  <js:TextButton text="Blank" click="blankimage()" />
> >>>              </js:Container>
> >>>          </js:View>
> >>>      </js:initialView>
> >>>
> >>>  </js:Application>
> >>>  ```
> >>>
> >>>  With this error:
> >>>  ```
> >>>  /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26):
> >> col: 130 This attribute is unexpected. It will be ignored.
> >>>
> >>>                  <js:Image id="image" src="https://www.apache.org/
> >> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
> >> layoutNeeded="showImage()" />
> >>>  ```
> >>>
> >>>  I assume the only way to do this would be to add a hard coded event
> >> listener manually like so?
> >>>
> >>>  ```
> >>>      <fx:Script><![CDATA[
> >>>          public function blankimage():void {
> >>>              image.visible = false;
> >>>              image.src =  "https://www.apache.org/
> foundation/press/kit/
> >> poweredBy/Apache_PoweredBy.png";
> >>>              image.addEventListener("layoutNeeded", showImage);
> >>>          }
> >>>
> >>>          public function showImage(event:Event):void {
> >>>              image.visible = true;
> >>>          }
> >>>          ]]></fx:Script>
> >>>  ```
> >>>
> >>>
> >>> ----------------------------------------------------------------
> >>> This is an automated message from the Apache Git Service.
> >>> To respond to the message, please log on GitHub and use the
> >>> URL above to go to the specific comment.
> >>>
> >>> For queries about this service, please contact Infrastructure at:
> >>> users@infra.apache.org
> >>>
> >>>
> >>> With regards,
> >>> Apache Git Services
> >>
> >>
> >
> >
> > --
> >
> > Piotr Zarzycki
> >
> > mobile: +48 880 859 557
> > skype: zarzycki10
> >
> > LinkedIn: http://www.linkedin.com/piotrzarzycki
> > <https://pl.linkedin.com/in/piotr-zarzycki-92a53552>
> >
> > GitHub: https://github.com/piotrzarzycki21
>
>


-- 

Piotr Zarzycki

mobile: +48 880 859 557
skype: zarzycki10

LinkedIn: http://www.linkedin.com/piotrzarzycki
<https://pl.linkedin.com/in/piotr-zarzycki-92a53552>

GitHub: https://github.com/piotrzarzycki21

Re: [GitHub] justinmclean commented on issue #60: Image not removed when src set to null

Posted by Harbs <ha...@gmail.com>.
Why? Unless it adds overhead, it seems to me like any event that can be added using addEventListener() should be addressable using MXML.

I’m just not sure from a technical perspective whether the MXML meta tags add overhead if not used.

> On Oct 30, 2017, at 8:02 PM, Piotr Zarzycki <pi...@gmail.com> wrote:
> 
> Hi Harbs,
> 
> Some time ago there were discussion on Flex Dev which makes me realize that
> we should add event tags as long as they are reflecting some native HTML
> api, unless we are in express. For example we are using in many places
> "change" event which is I believe quite common in JS world, but I would
> avoid any additional custom one. In the other world Let's answer to the
> question in following case - Does "img" in HTML world have "load" event ?
> 
> Piotr
> 
> 
> 2017-10-30 18:47 GMT+01:00 Harbs <ha...@gmail.com>:
> 
>> This does raise a good question:
>> 
>> Should we be adding MXML meta tags for all supported events? It seems like
>> a desirable thing to have, and there are currently very few event tags. I’m
>> not clear on whether the meta-tags effect the end result of code size.
>> 
>> Harbs
>> 
>>> On Oct 30, 2017, at 7:38 PM, GitBox <gi...@apache.org> wrote:
>>> 
>>> justinmclean commented on issue #60: Image not removed when src set to
>> null
>>> URL: https://github.com/apache/royale-asjs/issues/60#
>> issuecomment-340524197
>>> 
>>> 
>>>  This code fails to compile:
>>>  ```
>>>  <?xml version="1.0" encoding="utf-8"?>
>>>  <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>>>                  xmlns:js="library://ns.apache.org/royale/basic">
>>> 
>>>      <fx:Script><![CDATA[
>>>          import org.apache.flex.events.IEventDispatcher;
>>> 
>>>          public function blankimage():void {
>>>              image.visible = false;
>>>              image.src =  "https://www.apache.org/foundation/press/kit/
>> poweredBy/Apache_PoweredBy.png";
>>>          }
>>>          public function showImage():void {
>>>              image.visible = true;
>>>          }
>>>          ]]></fx:Script>
>>> 
>>>      <js:valuesImpl>
>>>          <js:SimpleCSSValuesImpl/>
>>>      </js:valuesImpl>
>>> 
>>>      <js:initialView>
>>> 
>>>          <js:View>
>>>              <js:Container id="startPage" visible="true" width="100%">
>>>                  <js:beads>
>>>                      <js:VerticalLayout />
>>>                  </js:beads>
>>>                  <js:Image id="image" src="https://www.apache.org/
>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>> layoutNeeded="showImage()" />
>>>                  <js:TextButton text="Blank" click="blankimage()" />
>>>              </js:Container>
>>>          </js:View>
>>>      </js:initialView>
>>> 
>>>  </js:Application>
>>>  ```
>>> 
>>>  With this error:
>>>  ```
>>>  /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26):
>> col: 130 This attribute is unexpected. It will be ignored.
>>> 
>>>                  <js:Image id="image" src="https://www.apache.org/
>> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
>> layoutNeeded="showImage()" />
>>>  ```
>>> 
>>>  I assume the only way to do this would be to add a hard coded event
>> listener manually like so?
>>> 
>>>  ```
>>>      <fx:Script><![CDATA[
>>>          public function blankimage():void {
>>>              image.visible = false;
>>>              image.src =  "https://www.apache.org/foundation/press/kit/
>> poweredBy/Apache_PoweredBy.png";
>>>              image.addEventListener("layoutNeeded", showImage);
>>>          }
>>> 
>>>          public function showImage(event:Event):void {
>>>              image.visible = true;
>>>          }
>>>          ]]></fx:Script>
>>>  ```
>>> 
>>> 
>>> ----------------------------------------------------------------
>>> This is an automated message from the Apache Git Service.
>>> To respond to the message, please log on GitHub and use the
>>> URL above to go to the specific comment.
>>> 
>>> For queries about this service, please contact Infrastructure at:
>>> users@infra.apache.org
>>> 
>>> 
>>> With regards,
>>> Apache Git Services
>> 
>> 
> 
> 
> -- 
> 
> Piotr Zarzycki
> 
> mobile: +48 880 859 557
> skype: zarzycki10
> 
> LinkedIn: http://www.linkedin.com/piotrzarzycki
> <https://pl.linkedin.com/in/piotr-zarzycki-92a53552>
> 
> GitHub: https://github.com/piotrzarzycki21


Re: [GitHub] justinmclean commented on issue #60: Image not removed when src set to null

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Harbs,

Some time ago there were discussion on Flex Dev which makes me realize that
we should add event tags as long as they are reflecting some native HTML
api, unless we are in express. For example we are using in many places
"change" event which is I believe quite common in JS world, but I would
avoid any additional custom one. In the other world Let's answer to the
question in following case - Does "img" in HTML world have "load" event ?

Piotr


2017-10-30 18:47 GMT+01:00 Harbs <ha...@gmail.com>:

> This does raise a good question:
>
> Should we be adding MXML meta tags for all supported events? It seems like
> a desirable thing to have, and there are currently very few event tags. I’m
> not clear on whether the meta-tags effect the end result of code size.
>
> Harbs
>
> > On Oct 30, 2017, at 7:38 PM, GitBox <gi...@apache.org> wrote:
> >
> > justinmclean commented on issue #60: Image not removed when src set to
> null
> > URL: https://github.com/apache/royale-asjs/issues/60#
> issuecomment-340524197
> >
> >
> >   This code fails to compile:
> >   ```
> >   <?xml version="1.0" encoding="utf-8"?>
> >   <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
> >                   xmlns:js="library://ns.apache.org/royale/basic">
> >
> >       <fx:Script><![CDATA[
> >           import org.apache.flex.events.IEventDispatcher;
> >
> >           public function blankimage():void {
> >               image.visible = false;
> >               image.src =  "https://www.apache.org/foundation/press/kit/
> poweredBy/Apache_PoweredBy.png";
> >           }
> >           public function showImage():void {
> >               image.visible = true;
> >           }
> >           ]]></fx:Script>
> >
> >       <js:valuesImpl>
> >           <js:SimpleCSSValuesImpl/>
> >       </js:valuesImpl>
> >
> >       <js:initialView>
> >
> >           <js:View>
> >               <js:Container id="startPage" visible="true" width="100%">
> >                   <js:beads>
> >                       <js:VerticalLayout />
> >                   </js:beads>
> >                   <js:Image id="image" src="https://www.apache.org/
> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
> layoutNeeded="showImage()" />
> >                   <js:TextButton text="Blank" click="blankimage()" />
> >               </js:Container>
> >           </js:View>
> >       </js:initialView>
> >
> >   </js:Application>
> >   ```
> >
> >   With this error:
> >   ```
> >   /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26):
> col: 130 This attribute is unexpected. It will be ignored.
> >
> >                   <js:Image id="image" src="https://www.apache.org/
> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
> layoutNeeded="showImage()" />
> >   ```
> >
> >   I assume the only way to do this would be to add a hard coded event
> listener manually like so?
> >
> >   ```
> >       <fx:Script><![CDATA[
> >           public function blankimage():void {
> >               image.visible = false;
> >               image.src =  "https://www.apache.org/foundation/press/kit/
> poweredBy/Apache_PoweredBy.png";
> >               image.addEventListener("layoutNeeded", showImage);
> >           }
> >
> >           public function showImage(event:Event):void {
> >               image.visible = true;
> >           }
> >           ]]></fx:Script>
> >   ```
> >
> >
> > ----------------------------------------------------------------
> > This is an automated message from the Apache Git Service.
> > To respond to the message, please log on GitHub and use the
> > URL above to go to the specific comment.
> >
> > For queries about this service, please contact Infrastructure at:
> > users@infra.apache.org
> >
> >
> > With regards,
> > Apache Git Services
>
>


-- 

Piotr Zarzycki

mobile: +48 880 859 557
skype: zarzycki10

LinkedIn: http://www.linkedin.com/piotrzarzycki
<https://pl.linkedin.com/in/piotr-zarzycki-92a53552>

GitHub: https://github.com/piotrzarzycki21