I’m thinking that all changes should go through a model and not the data 
source. The model can interface with that. So: model.getItemAt() and 
model.addItem() and so forth. 

This way the data source can be anything. Then our models like 
ArrayListSelectionModel can dispatch those events. We can even have 
ArraySelectionModel. App writers can extend these classes to make custom models 
or implement the interfaces from scratch. It would certainly help to have some 
uniformity.  

Peter 


> On Dec 9, 2017, at 3:09 PM, Peter Ent <[email protected]> wrote:
> 
> Piotr,
> 
> The model classes do not dispatch CollectionEvents - only ArrayList (or
> something like it) dispatches those events. So we cannot listen on the
> model.
> 
> What I've done, however, is change things in DynamicŠ so that when the
> dataProvider does change (or is initially present), then a listener is set
> up on that dataProvider. I think this will work and, in fact, work better.
> 
> Pull down my change and see if that works better.
> 
> ‹peter
> 
>> On 12/9/17, 6:17 AM, "Piotr Zarzycki" <[email protected]> wrote:
>> 
>> Peter,
>> 
>> That's when my initial implementation of that bead was to listen on model
>> instead directly on dataProvider. I'm using following beads [1] for MDL
>> Table and bead DynamicItemsRendererFactoryForArrayListData is being added
>> through CSS.
>> I hope that details help.
>> 
>> [1] 
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apa
>> che.org%2Foyex&data=02%7C01%7Cpent%40adobe.com%7C73405c25faf041c2b6a608d53
>> ef66915%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636484150397586526&sd
>> ata=XDE1Eh%2FS8%2FD%2BvQrHlzM9QhXFeC6pCkuU9jO30SLecTo%3D&reserved=0
>> 
>> Thanks, Piotr
>> 
>> 
>> 2017-12-09 11:16 GMT+01:00 piotrz <[email protected]>:
>> 
>>> Hi Peter,
>>> 
>>> I just tried newest build of Royale. I didn't use your new bead yet,
>>> but I
>>> had use the "DynamicItemsRendererFactoryForArrayListData", so decided to
>>> first build project without any changes.
>>> I'm getting NPE in this bead, cause my dataProvider initially is simply
>>> null.
>>> 
>>> 
>>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-r
>>> oyale-development.20373.n8.nabble.com%2Ffile%2Ft1%2Fnpe_dp.png&data=02%7C
>>> 01%7Cpent%40adobe.com%7C73405c25faf041c2b6a608d53ef66915%7Cfa7b1b5a7b3443
>>> 8794aed2c178decee1%7C0%7C0%7C636484150397586526&sdata=X5QFRzVGvb3U2ASb6AY
>>> dbE4imeRzuihhWUEhWvCDboU%3D&reserved=0>
>>> 
>>> 
>>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-r
>>> oyale-development.20373.n8.nabble&data=02%7C01%7Cpent%40adobe.com%7C73405
>>> c25faf041c2b6a608d53ef66915%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C
>>> 636484150397586526&sdata=PM7%2FkmhNoJPQ1vyCaJYMPQQutUDfNo9mK89r7l%2F5b3w%
>>> 3D&reserved=0.
>>> com/file/t1/npe_initially.png>
>>> 
>>> Thanks, Piotr
>>> 
>>> 
>>> 
>>> --
>>> Sent from: 
>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-ro
>>> yale-development.20373.n8.nabble.com%2F&data=02%7C01%7Cpent%40adobe.com%7
>>> C73405c25faf041c2b6a608d53ef66915%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%
>>> 7C0%7C636484150397586526&sdata=A%2FnYC0Pz0zJzloLH5yNnQnzR%2BFT2IzmPoGNBKe
>>> ybqHY%3D&reserved=0
>>> 
>> 
>> 
>> 
>> -- 
>> 
>> Piotr Zarzycki
>> 
>> Patreon: 
>> *https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patr
>> eon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C73405c25faf041c2
>> b6a608d53ef66915%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636484150397
>> 586526&sdata=yTNkr2RwZEmGixH4v57MWEnf3ahxBaG1DcyNGG39abA%3D&reserved=0
>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patr
>> eon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C73405c25faf041c2
>> b6a608d53ef66915%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636484150397
>> 586526&sdata=yTNkr2RwZEmGixH4v57MWEnf3ahxBaG1DcyNGG39abA%3D&reserved=0>*
> 

Reply via email to