We could, but it would be slightly more expensive. IMO it is a trade-off of usability vs code size.
Flex leaned towards usability, but we saw several customers never get off the launch pad because of code size performance. My 2 cents, -Alex On 11/1/17, 12:20 PM, "Idylog - Nicolas Granon" <[email protected]> wrote: >I do not really understand why we do not have a simple "DateChooserEvent" >with a "change" type, and "previousSelectedDate" and "selectedDate" >properties. > >Nicolas Granon > > > > >> -----Message d'origine----- >> De : Piotr Zarzycki [mailto:[email protected]] >> Envoyé : mercredi 1 novembre 2017 00:34 >> À : [email protected] >> Objet : Re: [royale-asjs] branch develop updated: Fixes #24 >> >> "change" event is being used widely in the framework, but in that case >> definitely more suites name "selectedDateChanged". >> >> Thanks! >> >> 2017-11-01 0:30 GMT+01:00 Harbs <[email protected]>: >> >> > Nope. >> > >> > Copying my response from Github: >> > >> > The only place change is referenced in the Framework is in the >> > metadata of >> > DateChooser: >> > [Event(name="change", type="org.apache.royale.events.Event")] >> > >> > That could easily be changed to: >> > [Event(name="selectedDateChanged", >> > type="org.apache.royale.events.Event")] >> > >> > The current metadata is actually incorrect, because the event type is >> > org.apache.royale.events.BrowserEvent >> > >> > Harbs >> > >> > > On Nov 1, 2017, at 1:29 AM, Piotr Zarzycki >> > > <[email protected]> >> > wrote: >> > > >> > > You can remove it if it is not fired it up for some other cases in >> > > DateChooser. >> > > >> > > Piotr >> > > >> > > 2017-11-01 0:23 GMT+01:00 Harbs <[email protected]>: >> > > >> > >> My comment in the commit message needs discussion. >> > >> >> > >> I think the change event should be removed. What do others think? >> > >> >> > >> Harbs >> > >> >> > >>> On Nov 1, 2017, at 1:14 AM, [email protected] wrote: >> > >>> >> > >>> This is an automated email from the ASF dual-hosted git >> repository. >> > >>> >> > >>> harbs pushed a commit to branch develop in repository >> > >>> >>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.a >>pache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7C%7C6139a5aa32294 >>70b10f608d5215d9f92%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63645160 >>8356973575&sdata=Ocj1QqZaV9nhmo2qNlvh6Y6IlCzmo2XcTFzrdqJUBzE%3D&reserved= >>0 >> > >>> >> > >>> >> > >>> The following commit(s) were added to refs/heads/develop by this >> push: >> > >>> new 2072541 Fixes #24 >> > >>> 2072541 is described below >> > >>> >> > >>> commit 2072541f1f9da5ed1780d497a6ec5fab52674b91 >> > >>> Author: Harbs <[email protected]> >> > >>> AuthorDate: Wed Nov 1 01:14:29 2017 +0200 >> > >>> >> > >>> Fixes #24 >> > >>> >> > >>> I’m not sure why we’re dispatching both a “selctedDateChanged” >> > >>> event >> > >> and a “changed” event for the same action. It seems like we should >> > dispatch >> > >> one or the other. >> > >>> On the one hand, “change” is a standard name, so it’s easily >> > >> discoverable. On the other hand, “change” is one of the special >> > >> events which become BrowserEvents when dispatched. >> > >>> I think the change event should be removed. >> > >>> --- >> > >>> .../org/apache/royale/html/beads/DateChooserView.as | 16 >> > >> ++++++++++++---- >> > >>> .../html/beads/controllers/DateChooserMouseController.as | 1 - >> > >>> 2 files changed, 12 insertions(+), 5 deletions(-) >> > >>> >> > >>> diff --git >> a/frameworks/projects/Basic/src/main/royale/org/apache/ >> > >> royale/html/beads/DateChooserView.as b/frameworks/projects/Basic/ >> > >> src/main/royale/org/apache/royale/html/beads/DateChooserView.as >> > >>> index 2316f4a..17a5ef0 100644 >> > >>> --- a/frameworks/projects/Basic/src/main/royale/org/apache/ >> > >> royale/html/beads/DateChooserView.as >> > >>> +++ b/frameworks/projects/Basic/src/main/royale/org/apache/ >> > >> royale/html/beads/DateChooserView.as >> > >>> @@ -86,6 +86,13 @@ package org.apache.royale.html.beads >> > >>> private var daysContainer:DateChooserList; >> > >>> >> > >>> /** >> > >>> + * @royaleignorecoercion >> org.apache.royale.core.UIBase >> > >>> + */ >> > >>> + private function getHost():UIBase >> > >>> + { >> > >>> + return _strand as UIBase; >> > >>> + } >> > >>> + /** >> > >>> * The button that causes the previous month to be >> > >> displayed by the DateChooser. >> > >>> * >> > >>> * @langversion 3.0 >> > >>> @@ -171,7 +178,7 @@ package org.apache.royale.html.beads >> > >>> _nextMonthButton.style.flexGrow = 0; >> > >>> monthButtonsContainer. >> > >> addElement(_nextMonthButton); >> > >>> >> > >>> - UIBase(_strand).addElement( >> > monthButtonsContainer, >> > >> false); >> > >>> + getHost().addElement(monthButtonsContainer, >> > >> false); >> > >>> >> > >>> // DAY NAMES >> > >>> >> > >>> @@ -188,7 +195,7 @@ package org.apache.royale.html.beads >> > >>> COMPILE::SWF { >> > >>> dayNamesContainer.percentWidth = >> 100; >> > >>> } >> > >>> - >> UIBase(_strand).addElement(dayNamesContainer, >> > >> false); >> > >>> + getHost().addElement(dayNamesContainer, >> > >>> + false); >> > >>> >> > >>> // DAYS >> > >>> >> > >>> @@ -203,7 +210,7 @@ package org.apache.royale.html.beads >> > >>> COMPILE::SWF { >> > >>> daysContainer.percentWidth = 100; >> > >>> } >> > >>> - UIBase(_strand).addElement(daysContainer, >> > false); >> > >>> + getHost().addElement(daysContainer, false); >> > >>> >> > >>> >> > >>> >> > >>> IEventDispatcher(daysContainer).dispatchEvent( >> > >> new Event("itemsCreated") ); >> > >>> @@ -233,7 +240,8 @@ package org.apache.royale.html.beads >> > >>> var index:Number = >> > >>> model.getIndexForSelectedDate( >> > >> ); >> > >>> daysContainer.selectedIndex = index; >> > >>> >> > >>> - IEventDispatcher(_strand).dispatchEvent(new >> > >> Event("selectedDateChanged")); >> > >>> + getHost().dispatchEvent(new >> > >> Event("selectedDateChanged")); >> > >>> + getHost().dispatchEvent( new >> Event("change") >> > >>> + ); >> > >>> } >> > >>> >> > >>> /** >> > >>> diff --git >> a/frameworks/projects/Basic/src/main/royale/org/apache/ >> > >> royale/html/beads/controllers/DateChooserMouseController.as >> > >> b/frameworks/projects/Basic/src/main/royale/org/apache/ >> > >> royale/html/beads/controllers/DateChooserMouseController.as >> > >>> index d3ef05c..ccf3cbc 100644 >> > >>> --- a/frameworks/projects/Basic/src/main/royale/org/apache/ >> > >> royale/html/beads/controllers/DateChooserMouseController.as >> > >>> +++ b/frameworks/projects/Basic/src/main/royale/org/apache/ >> > >> royale/html/beads/controllers/DateChooserMouseController.as >> > >>> @@ -81,7 +81,6 @@ package >> org.apache.royale.html.beads.controllers >> > >>> var list:DateChooserList = event.target as >> DateChooserList; >> > >>> var model:DateChooserModel = _strand.getBeadByType( >> > IBeadModel) >> > >> as DateChooserModel; >> > >>> model.selectedDate = list.selectedItem as Date; >> > >>> - IEventDispatcher(_strand).dispatchEvent( new >> > >> Event("change") ); >> > >>> } >> > >>> >> > >>> /** >> > >>> >> > >>> -- >> > >>> To stop receiving notification emails like this one, please >> > >>> contact ['"[email protected]" >> <[email protected]>']. >> > >> >> > >> >> > > >> > > >> > > -- >> > > >> > > 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%7C6139a5aa3229470b10f608d5215d9f9 >>2%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636451608356973575&sdata=P >>JJGKZeTv5s5ExoheNTQEcUUMgHe8HJ5%2BLqjTkcKHR0%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%7C6139a5aa3229470 >>b10f608d5215d9f92%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364516083 >>56973575&sdata=wyYEIx%2Bck8VBenBOycxVpacCep9%2BeozFQAvrt8S4jYU%3D&reserve >>d=0> >> > > >> > > GitHub: >>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.c >>om%2Fpiotrzarzycki21&data=02%7C01%7C%7C6139a5aa3229470b10f608d5215d9f92%7 >>Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636451608356973575&sdata=STI% >>2FSOMxx5Hg2OI5FnA29pgjmUzxla6oU1QZNqetI8c%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%7C6139a5aa3229470b10f608d5215d9f9 >>2%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636451608356973575&sdata=P >>JJGKZeTv5s5ExoheNTQEcUUMgHe8HJ5%2BLqjTkcKHR0%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%7C6139a5aa3229470 >>b10f608d5215d9f92%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364516083 >>56973575&sdata=wyYEIx%2Bck8VBenBOycxVpacCep9%2BeozFQAvrt8S4jYU%3D&reserve >>d=0> >> >> GitHub: >>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.c >>om%2Fpiotrzarzycki21&data=02%7C01%7C%7C6139a5aa3229470b10f608d5215d9f92%7 >>Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636451608356973575&sdata=STI% >>2FSOMxx5Hg2OI5FnA29pgjmUzxla6oU1QZNqetI8c%3D&reserved=0 >
