Alex, I was giving this some more thought also. I understood that you meant
to add extra events for binding from your previous comments.
But isn't the established pattern to add a bead to listen for the
selectionChange and redispatch it as change?
At least that seems to be the case elsewhere
If I look at the code in Basic TextInput...
it dispatches 'textChange' and 'change' but is only Bindable via 'change'.
There is effort to keep them distinct/separate.
(OT: It looks like the swf side needs some consistency in the html setter
same as the text setter.)
So TextInput appears to have 2 distinct events but only be Bindable for one
('change'). So I presume that to make that support programmatic changes it
would be by adding a bead to listen to the 'textChange' and redispatch as
'change' ?
Adding extra Bindable events adds weight because it affects binding data,
and creates more runtime support for the same feature in use cases that may
not need it. I don't see how that can be 'PAYG-ised' because binding
support for different event types is either there at compile time or it is
not in the component. So if the above is true for TextInput (at this stage
it's a guess/observation, I did not try this yet), then could it not be
similar for selection based components?
To me 'change' seems like something generic and does not sound specific to
being user-initiated change. My understanding is that it just happens to be
that way by default, unless you configure it to include programmatic
changes via bead.
If it is like this for Basic TextInput, why can it not be the same for
other components ? (
On Tue, Dec 18, 2018 at 7:32 AM Alex Harui <[email protected]> wrote:
> I took a quick look at ArrayListSelection. It could use some
> improvements, such as only dispatching a single selectionChange event
> instead of both selectedIndexChange and selectedItemChange.
>
> Some controller should dispatch the "change" event, not the model.
>
> I took a quick look at List.as, (a top level component). It should have
> bindable metadata that looks like this:
>
> [Bindable("change")]
> [Bindable("selectionChange")]
> public function get selectedIndex():int
>
> Similar for selectedItem. The [Event] metadata for List is correct, It
> should only list interactive events like "change" and not bindable events
> like selectionChange. This usually improves performance by not having the
> UI react to setup.
>
> Once all of those changes are made, we should discuss any remaining issues.
>
> My 2 cents,
> -Alex
>
> On 12/17/18, 10:14 AM, "Piotr Zarzycki" <[email protected]>
> wrote:
>
> Basic ArrayListSelection model doesn't dispatch that event. I believe
> we
> don't have to do this or rather do this only if we really need it, for
> example if someone make programatic change of selectedIndex. - This is
> general problem how to do that ?
>
> If I change selectedIndex - my model dispatch selectedInexChanged -
> where
> should I catch it and dispatch "change" event ? My though are nowhere,
> unless someone wanted to do that and have a bead.
>
>
> pon., 17 gru 2018 o 19:08 Alex Harui <[email protected]>
> napisał(a):
>
> > Hi Piotr,
> >
> > I may not be understanding your problem. Not all models will
> dispatch a
> > change event, but it is hard to imagine a selection model that
> doesn't.
> >
> > -Alex
> >
> > On 12/17/18, 9:36 AM, "Piotr Zarzycki" <[email protected]>
> wrote:
> >
> > I will review your email again and see what can I do this.
> However
> > this one
> > is a second problem. First one was about programmatic change
> discover
> > - If
> > you are talking about that - Let me check your earlier emails.
> >
> > Thanks,
> > Piotr
> >
> > pon., 17 gru 2018 o 18:30 Alex Harui <[email protected]>
> > napisał(a):
> >
> > > FWIW, I would much rather see energy spent on trying to
> implement the
> > > patterns I suggested earlier, which will hopefully eliminate
> the
> > need for
> > > DispatchChangeOnStartup.
> > >
> > > My 2 cents,
> > > -Alex
> > >
> > > On 12/17/18, 4:34 AM, "Piotr Zarzycki" <
> [email protected]>
> > wrote:
> > >
> > > Carlos,
> > >
> > > I don't understand this sentence -> " If not we can get
> involved
> > in
> > > pursues
> > > problems
> > > that are not real." - What do you mean here ?
> > >
> > > Ok I can wait for Alex review.
> > >
> > > However your review and look into above problem doesn't
> need
> > Alex's
> > > attention. This bead (DispatchChangeOnStartup) probably
> won't
> > work
> > > doesn't
> > > matter if we fix programmatic change or not. - Unless I
> bring
> > back
> > > dispatching "change" event from model - which rather is not
> > > recommended in
> > > previous discussion.
> > >
> > > Thanks, Piotr
> > >
> > > pon., 17 gru 2018 o 13:14 Carlos Rovira <
> [email protected]
> > >
> > > napisał(a):
> > >
> > > > Hi Piotr,
> > > >
> > > > I think we should solve first the programatic change so
> I can
> > test
> > > the
> > > > branch and see regressions. If not we can get involved in
> > pursues
> > > problems
> > > > that are not real. I think Alex missed this discussion.
> I'll
> > point
> > > him in
> > > > this thread to see if he can give his opinion about the
> ways
> > you
> > > proposed
> > > > in the initial thread email.
> > > >
> > > > Thanks!
> > > >
> > > > El lun., 17 dic. 2018 a las 10:57, Piotr Zarzycki (<
> > > > [email protected]>) escribió:
> > > >
> > > > > Hi Carlos,
> > > > >
> > > > > I just noticed that if model do not dispatch change
> event -
> > your
> > > bead
> > > > > DispatchChangeOnStartup won't work because it simply
> based on
> > > dispatching
> > > > > "change" event trough model.
> > > > >
> > > > > I'm wondering whether it won't be enough if that bead
> listen
> > for
> > > > > "beadsAdded" (here I think it should be registered for
> > > "initComplete"
> > > > > instead) and dispatch change event once. I made the
> changes
> > to
> > > that bead,
> > > > > but I don't have scenario which you are using it.
> > > > >
> > > > > Will you be able to test my changes on your
> application end
> > using
> > > my
> > > > > branch ? Above changes are not fully related to what
> we are
> > > discussing
> > > > > here, so programmatic change still won't work yet.
> Please
> > review
> > > those
> > > > > changes as well [1]
> > > > >
> > > > > Those new changes are just to check whether I won't
> break
> > any of
> > > your
> > > > > functionality on startup. I will move for creating
> bead for
> > > discovering
> > > > > programmatic changes, but first would like to know
> whether
> > till now
> > > > > everything is working fine.
> > > > >
> > > > > [1]
> > > > >
> > > > >
> > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fcommit%2F14f6354e037e5854900ef5620581f6914bd604c4&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=m6XKDAfolU4fN73fDrCQzpFl9rmiJERq9qZS5JGkeGM%3D&reserved=0
> > > > >
> > > > > Thanks, Piotr
> > > > >
> > > > >
> > > > > pt., 14 gru 2018 o 19:55 Carlos Rovira <
> > [email protected]>
> > > > > napisał(a):
> > > > >
> > > > > > Hi Piotr,
> > > > > >
> > > > > > after check example code, we have:
> > > > > >
> > > > > > <j:ComboBox id="watchmenComboBox"
> > > dataProvider="{listModel.watchmen}">
> > > > > > ...
> > > > > > then NS:
> > > > > >
> > > > > > <j:NumericStepper
> > valueChange="watchmenComboBox.selectedIndex =
> > > > > > event.target.value" minimum="0" maximum="5"/>
> > > > > >
> > > > > > and finally
> > > > > >
> > > > > > <j:Label id="watchmenComboBoxResult" html=
> > > > > > "{describeItem(watchmenComboBox.selectedItem)}"/>
> > > > > >
> > > > > > I think right now works as expected, since the
> change is
> > > programatic
> > > > (is
> > > > > > not the user clicking in the combo list and selecting
> > other item
> > > > > >
> > > > > > So I think a bead should be better in this case, that
> > takes care
> > > of
> > > > this
> > > > > > behavior.
> > > > > >
> > > > > > I'm interested in Alex response about how to handle
> it
> > > > > >
> > > > > > Thanks Piotr for working on this
> > > > > >
> > > > > > Carlos
> > > > > >
> > > > > >
> > > > > >
> > > > > > El vie., 14 dic. 2018 a las 17:02, Piotr Zarzycki (<
> > > > > > [email protected]>) escribió:
> > > > > >
> > > > > > > Hi Carlos,
> > > > > > >
> > > > > > > I have created issue [1] and branch [2] for
> problem with
> > double
> > > > > dispatch
> > > > > > > "change" event.
> > > > > > > I have pushed changes when I'm removing from
> > > ArrayListSelectionModel
> > > > > > > dispatch of change event.
> > > > > > >
> > > > > > > Above action successfully fix however like I
> thought it's
> > > introduces
> > > > > > > another one which I would like to discuss how to
> fix. I
> > have
> > > deployed
> > > > > > > temporary Tour De Jewel here [3] in order to show
> you
> > and to
> > > others
> > > > > that
> > > > > > > issue.
> > > > > > >
> > > > > > > *New Issue:*
> > > > > > > When you go to ComboBox and try to change
> selectedIndex
> > using
> > > > > > > NumericStepper it will successfully change
> selectedItem
> > in
> > > ComboBox.
> > > > > > > Unfortunately label on the right sight of ComboBox
> won't
> > be
> > > updated.
> > > > > > >
> > > > > > > *Question is:*
> > > > > > > How should be implemented discover of programmatic
> > change of
> > > > > > selectedIndex
> > > > > > > and selectedItem ?
> > > > > > >
> > > > > > > *I see following options:*
> > > > > > > 1) We should listen on events
> > > > selectedIndexChanged/selectedItemChanged
> > > > > > and
> > > > > > > dispatch "change" from components View bead. In
> this way
> > we
> > > have to
> > > > > take
> > > > > > > into account places where "we" as a component
> setup those
> > > properties
> > > > > > > internally - In that case "selectedIndexChanged"
> and
> > > > > > "selectedItemChanged"
> > > > > > > event shouldn't be dispatch.
> > > > > > >
> > > > > > > 2) Create separate bead which allows discover
> > programmatic
> > > change of
> > > > > > > selectedIndex and selectedItem- cause not everyone
> > wanted to
> > > have at
> > > > > all
> > > > > > > programmatic change event in the component -
> probably
> > most of
> > > the
> > > > cases
> > > > > > > will be opposite.
> > > > > > >
> > > > > > > What others think about that ?
> > > > > > >
> > > > > > > [1]
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fissues%2F353&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=dnx5iT9hGNYItvNjaI9KpGaZAES0GgaKNi8%2B3zfkGh0%3D&reserved=0
> > > > > > > [2]
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Ftree%2Fbugfix%2Fissue_353_double_dispatch_of_change_event_in_Jewel_List&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=yC430CW9GWjU2sZ%2FqXCcN7dXZq32pw11O09gXsRuPJk%3D&reserved=0
> > > > > > > [3]
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftranspiledactionscript.com%2Fdev%2Froyale%2F%23&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=ninDi7%2FTbcof10PejcO9N4sdpinAA3vnSJO%2Fqm%2BjZJU%3D&reserved=0
> > > > > > >
> > > > > > > Thanks,
> > > > > > > --
> > > > > > >
> > > > > > > Piotr Zarzycki
> > > > > > >
> > > > > > > Patreon: *
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=v5aKUZQmfzJNmY7wuFM6Fx2bpxtl19TiZea9ESw9nSg%3D&reserved=0
> > > > > > > <
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=v5aKUZQmfzJNmY7wuFM6Fx2bpxtl19TiZea9ESw9nSg%3D&reserved=0
> > > >*
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Carlos Rovira
> > > > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=TcXyzEDlomUT%2FBeKmYOZSVrRt8bnAOYODgAVrFtdopA%3D&reserved=0
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > Piotr Zarzycki
> > > > >
> > > > > Patreon: *
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712923442&sdata=v5aKUZQmfzJNmY7wuFM6Fx2bpxtl19TiZea9ESw9nSg%3D&reserved=0
> > > > > <
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=rrQm6iMoNmi1KMuTXDQ3yKfFVtyjh3XIVEFB4Gj6570%3D&reserved=0
> > > >*
> > > > >
> > > >
> > > >
> > > > --
> > > > Carlos Rovira
> > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=%2BxG8ws5YyPeZFVMJ%2Fsr4dvLEfUUGi7AwHVP2N2mkGp0%3D&reserved=0
> > > >
> > >
> > >
> > > --
> > >
> > > Piotr Zarzycki
> > >
> > > Patreon: *
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=rrQm6iMoNmi1KMuTXDQ3yKfFVtyjh3XIVEFB4Gj6570%3D&reserved=0
> > > <
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=rrQm6iMoNmi1KMuTXDQ3yKfFVtyjh3XIVEFB4Gj6570%3D&reserved=0
> > > >*
> > >
> > >
> > >
> >
> > --
> >
> > Piotr Zarzycki
> >
> > Patreon: *
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=rrQm6iMoNmi1KMuTXDQ3yKfFVtyjh3XIVEFB4Gj6570%3D&reserved=0
> > <
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=rrQm6iMoNmi1KMuTXDQ3yKfFVtyjh3XIVEFB4Gj6570%3D&reserved=0
> > >*
> >
> >
> >
>
> --
>
> Piotr Zarzycki
>
> Patreon: *
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=rrQm6iMoNmi1KMuTXDQ3yKfFVtyjh3XIVEFB4Gj6570%3D&reserved=0
> <
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C932d5189b02f4227456d08d6644b7cc5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806672712933456&sdata=rrQm6iMoNmi1KMuTXDQ3yKfFVtyjh3XIVEFB4Gj6570%3D&reserved=0
> >*
>
>
>