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/28 23:48:19 UTC

Re: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

This change made updating the dataProvider in the DataGridExample work, but it seems to have caused an endless recursive layout in some cases.

I’ve reverted it because it seems to have broken existing apps, but I’m not completely sure why.

I’m left with the question of how to allow changes to ArrayLists propagating to the view without causing the endless loop…

> On Oct 29, 2017, at 1:43 AM, harbs@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> harbs pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> 
> commit 9d20a649a7d417ca62724c98f3906c0d160172ae
> Author: Harbs <ha...@in-tools.com>
> AuthorDate: Sun Oct 29 01:41:08 2017 +0200
> 
>    Revert "Updating the source of an ArrayList does not change the view of the component without this change."
> 
>    This reverts commit 313cf14147dfdd53b621b82b949b8544d2b6ed91.
> ---
> .../org/apache/royale/html/beads/models/ArrayListSelectionModel.as       | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> index ec10892..81c606c 100644
> --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> @@ -84,6 +84,7 @@ package org.apache.royale.html.beads.models
>          */
> 		public function set dataProvider(value:Object):void
> 		{
> +            if (value == _dataProvider) return;
> 
>             _dataProvider = value as IArrayList;
> 			if(!_dataProvider || _selectedIndex >= _dataProvider.length)
> 
> -- 
> To stop receiving notification emails like this one, please contact
> "commits@royale.apache.org" <co...@royale.apache.org>.


RE: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

Posted by Yishay Weiss <yi...@hotmail.com>.
ArrayList is already dispatching fine-grained collection events:



                                public static const ITEM_ADDED:String = "itemAdded";

                                public static const ITEM_REMOVED:String = "itemRemoved";

                                public static const ITEM_UPDATED:String = "itemUpdated";

                                public static const COLLECTION_CHANGED:String = "collectionChanged";



The problem we had was that the list columns weren’t being updated as a result of these (or the edge case of the ArrayList src being changed).







________________________________
From: Peter Ent <pe...@adobe.com.INVALID>
Sent: Monday, October 30, 2017 5:10:58 PM
To: dev@royale.apache.org
Subject: Re: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

The initial versions of Basic data providers and their like were not
intended to be complete. Some of it is still proof of concept. The stuff
that's there is really meant for a more static viewing rather than being
dynamic. Plus there is no code to support virtualized lists of any sort.

With the fundamentals working, we should probably create a new set (not a
replacement, just new/more) data provider classes that can handle updates
and deletes properly. I would not change what's there unless there is a
real bug when it comes to reading the data and generating itemRenderers
because that's all it is supposed to do.

The ArrayList class, I think, should be made complete: create, add,
update, delete. Perhaps that isn't PAYG - I have a hard time telling
sometimes. Do most people want create-only? If that's the case, then
ArrayListPlus or SuperArrayList could include the other functions - that
would be more PAYG.

‹peter

On 10/28/17, 7:48 PM, "Harbs" <ha...@gmail.com> wrote:

>This change made updating the dataProvider in the DataGridExample work,
>but it seems to have caused an endless recursive layout in some cases.
>
>I¹ve reverted it because it seems to have broken existing apps, but I¹m
>not completely sure why.
>
>I¹m left with the question of how to allow changes to ArrayLists
>propagating to the view without causing the endless loopŠ
>
>> On Oct 29, 2017, at 1:43 AM, harbs@apache.org 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%7C98bf6f3837ba4
>>d6746ff08d51e5e638d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63644831
>>3127940766&sdata=OCGyB8FulE%2Fc0UPp2dSnQJ4yIynBlhqDUo%2BP%2B7um%2B10%3D&r
>>eserved=0
>>
>> commit 9d20a649a7d417ca62724c98f3906c0d160172ae
>> Author: Harbs <ha...@in-tools.com>
>> AuthorDate: Sun Oct 29 01:41:08 2017 +0200
>>
>>    Revert "Updating the source of an ArrayList does not change the view
>>of the component without this change."
>>
>>    This reverts commit 313cf14147dfdd53b621b82b949b8544d2b6ed91.
>> ---
>> .../org/apache/royale/html/beads/models/ArrayListSelectionModel.as
>> | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git
>>a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>>b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> index ec10892..81c606c 100644
>> ---
>>a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> +++
>>b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> @@ -84,6 +84,7 @@ package org.apache.royale.html.beads.models
>>          */
>>               public function set dataProvider(value:Object):void
>>               {
>> +            if (value == _dataProvider) return;
>>
>>             _dataProvider = value as IArrayList;
>>                       if(!_dataProvider || _selectedIndex >= _dataProvider.length)
>>
>> --
>> To stop receiving notification emails like this one, please contact
>> "commits@royale.apache.org" <co...@royale.apache.org>.
>


Re: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

Posted by Peter Ent <pe...@adobe.com.INVALID>.
The initial versions of Basic data providers and their like were not
intended to be complete. Some of it is still proof of concept. The stuff
that's there is really meant for a more static viewing rather than being
dynamic. Plus there is no code to support virtualized lists of any sort.

With the fundamentals working, we should probably create a new set (not a
replacement, just new/more) data provider classes that can handle updates
and deletes properly. I would not change what's there unless there is a
real bug when it comes to reading the data and generating itemRenderers
because that's all it is supposed to do.

The ArrayList class, I think, should be made complete: create, add,
update, delete. Perhaps that isn't PAYG - I have a hard time telling
sometimes. Do most people want create-only? If that's the case, then
ArrayListPlus or SuperArrayList could include the other functions - that
would be more PAYG.

‹peter

On 10/28/17, 7:48 PM, "Harbs" <ha...@gmail.com> wrote:

>This change made updating the dataProvider in the DataGridExample work,
>but it seems to have caused an endless recursive layout in some cases.
>
>I¹ve reverted it because it seems to have broken existing apps, but I¹m
>not completely sure why.
>
>I¹m left with the question of how to allow changes to ArrayLists
>propagating to the view without causing the endless loopŠ
>
>> On Oct 29, 2017, at 1:43 AM, harbs@apache.org 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%7C98bf6f3837ba4
>>d6746ff08d51e5e638d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63644831
>>3127940766&sdata=OCGyB8FulE%2Fc0UPp2dSnQJ4yIynBlhqDUo%2BP%2B7um%2B10%3D&r
>>eserved=0
>> 
>> commit 9d20a649a7d417ca62724c98f3906c0d160172ae
>> Author: Harbs <ha...@in-tools.com>
>> AuthorDate: Sun Oct 29 01:41:08 2017 +0200
>> 
>>    Revert "Updating the source of an ArrayList does not change the view
>>of the component without this change."
>> 
>>    This reverts commit 313cf14147dfdd53b621b82b949b8544d2b6ed91.
>> ---
>> .../org/apache/royale/html/beads/models/ArrayListSelectionModel.as
>> | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git 
>>a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>>b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> index ec10892..81c606c 100644
>> --- 
>>a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> +++ 
>>b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> @@ -84,6 +84,7 @@ package org.apache.royale.html.beads.models
>>          */
>> 		public function set dataProvider(value:Object):void
>> 		{
>> +            if (value == _dataProvider) return;
>> 
>>             _dataProvider = value as IArrayList;
>> 			if(!_dataProvider || _selectedIndex >= _dataProvider.length)
>> 
>> -- 
>> To stop receiving notification emails like this one, please contact
>> "commits@royale.apache.org" <co...@royale.apache.org>.
>


Re: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

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

I like your changes :) I just added couple of minor suggestions in the
github.

Thanks!

2017-11-01 16:50 GMT+01:00 yishayw <yi...@hotmail.com>:

> Hi Peter,
>
> Thanks for the detailed explanation. As I understand it, the vision you
> outlined is already implemented, we just need to listen to more of these
> fine-grained events in the mappers which can happen DAYG.
>
> I personally don't see anything wrong with this architecture, maybe Harbs
> who's taken a deeper look will have something to add.
>
> I will merge data_grid_update into develop sometime soon unless I hear
> objections.
>
> Thanks.
>
>
>
>
>
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>



-- 

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: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

Posted by yishayw <yi...@hotmail.com>.
Hi Peter,

Thanks for the detailed explanation. As I understand it, the vision you
outlined is already implemented, we just need to listen to more of these
fine-grained events in the mappers which can happen DAYG.

I personally don't see anything wrong with this architecture, maybe Harbs
who's taken a deeper look will have something to add.

I will merge data_grid_update into develop sometime soon unless I hear
objections.

Thanks.





--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

RE: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

Posted by Yishay Weiss <yi...@hotmail.com>.
I’ve created a branch data_grid_update that contains my proposed fix to this. You can see usage here [1].



[1] https://github.com/yishayw/Examples/blob/DataGrid_force_change/Examples.mxml



________________________________
From: Yishay Weiss <yi...@hotmail.com>
Sent: Monday, October 30, 2017 5:27:58 PM
To: dev@royale.apache.org
Subject: RE: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

Currently the composite view (DataGridView) has some code designed to propagate the data change event to its subviews (DataGridColumnList). I think we need to move this code to a separate bead. Then we’ll have finer control over whether or not changes in runtime are reflected in the view. I’ll try to create a branch demonstrating this.



________________________________
From: Harbs <ha...@gmail.com>
Sent: Sunday, October 29, 2017 1:48:19 AM
To: dev@royale.apache.org
Subject: Re: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

This change made updating the dataProvider in the DataGridExample work, but it seems to have caused an endless recursive layout in some cases.

I’ve reverted it because it seems to have broken existing apps, but I’m not completely sure why.

I’m left with the question of how to allow changes to ArrayLists propagating to the view without causing the endless loop…

> On Oct 29, 2017, at 1:43 AM, harbs@apache.org wrote:
>
> This is an automated email from the ASF dual-hosted git repository.
>
> harbs pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
> commit 9d20a649a7d417ca62724c98f3906c0d160172ae
> Author: Harbs <ha...@in-tools.com>
> AuthorDate: Sun Oct 29 01:41:08 2017 +0200
>
>    Revert "Updating the source of an ArrayList does not change the view of the component without this change."
>
>    This reverts commit 313cf14147dfdd53b621b82b949b8544d2b6ed91.
> ---
> .../org/apache/royale/html/beads/models/ArrayListSelectionModel.as       | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> index ec10892..81c606c 100644
> --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> @@ -84,6 +84,7 @@ package org.apache.royale.html.beads.models
>          */
>                public function set dataProvider(value:Object):void
>                {
> +            if (value == _dataProvider) return;
>
>             _dataProvider = value as IArrayList;
>                        if(!_dataProvider || _selectedIndex >= _dataProvider.length)
>
> --
> To stop receiving notification emails like this one, please contact
> "commits@royale.apache.org" <co...@royale.apache.org>.


Re: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

Posted by Peter Ent <pe...@adobe.com.INVALID>.
Hi,

I've been going over this and sketching stuff in my notebook. I'd like to
do a little reset thinking about DataGrid.

First, the idea of moving updates to the dataProvider from the
DataGridView into a separate beads seem like a good idea to me. It should
allow how that gets handled to be changed if needed without affecting how
the DataGrid is composed.

The DataGrid is composed of a ButtonBar and a Container which has a set of
Lists, one per column. The idea is that the Lists share the dataProvider
found in the DataGridModel and from this dataProvider, along with the
DataGridColumn specifications (also in the DataGridModel), generate
itemRenderer instances. I don't know if this is the best way to make a
DataGrid in Royale; it seems like it but it is also a little difficult
getting the Lists to coordinate with each other.

Forgot - for the moment - about PAYG. Ideally, the dataProvider is capable
of sending out events when it changes - new items added, items changed,
items deleted. Since the Lists are using the same dataProvider, the Lists
should be able to react to those changes and update themselves
accordingly. This means something in the Lists - probably their models -
is set up to listen for changes to the dataProvider and then get whatever
is in the Lists to handle the dataProvider[index] <-> itemRenderer
mapping. 

If you delete dataProvider[2] (the third item), the dataProvider would
send an ITEM_DELETED event out. The Lists have a bead that is generating
the itemRenderers from the dataProvider and it does so when the
dataProvider changes. Those mapper beads should pick up the delete event
and remove the corresponding itemRenderer. Then those beads send out a
LAYOUT_NEEDED event. The layout beads for each List then take the
itemRenderers and arrange them according to their algorithms. (Note that
LAYOUT_NEEDED is dispatched from the List itself as a common listening
point for intra-bead communication).

This, at least, is how it should work. Bringing back PAYG: Not everyone
needs dataProviders that can handle dynamic changes. Which is why the List
has beads for both Array based dataProviders and ArrayList dataProviders.
There are also Array and ArrayList data provider/itemRenderer mappers.

When dealing with Array, the common case, I think model and mapper beads
should only respond to wholesale changes to the dataProvider - effectively
replacement. Array doesn't produce change events, so the basic beads
should not handle them.

In PAYG fashion, the ArrayList model and mapper beads should handle
dynamic changes. Maybe at first the mapper bead would just treat
everything the same: delete all itemRenderers and re-generate them and
then dispatch LAYOUT_NEEDED. Updated versions could handle change, insert,
and delete with better event messages from the mapper to the layout which
means another set of fancy layout beads that handle subtle changes and fit
with the PAYG philosophy.

I hope that helps. Its how I view things. I do believe the ArrayList
version of the models and mappers need updating a bit, especially now that
we've learned more in putting this system together.

‹peter

On 10/30/17, 11:27 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:

>Currently the composite view (DataGridView) has some code designed to
>propagate the data change event to its subviews (DataGridColumnList). I
>think we need to move this code to a separate bead. Then we¹ll have finer
>control over whether or not changes in runtime are reflected in the view.
>I¹ll try to create a branch demonstrating this.
>
>
>
>________________________________
>From: Harbs <ha...@gmail.com>
>Sent: Sunday, October 29, 2017 1:48:19 AM
>To: dev@royale.apache.org
>Subject: Re: [royale-asjs] 02/02: Revert "Updating the source of an
>ArrayList does not change the view of the component without this change."
>
>This change made updating the dataProvider in the DataGridExample work,
>but it seems to have caused an endless recursive layout in some cases.
>
>I¹ve reverted it because it seems to have broken existing apps, but I¹m
>not completely sure why.
>
>I¹m left with the question of how to allow changes to ArrayLists
>propagating to the view without causing the endless loopŠ
>
>> On Oct 29, 2017, at 1:43 AM, harbs@apache.org 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%7C48422f6c72824
>>d28c34608d51faad3da%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63644974
>>0915040368&sdata=s0gVEd8QkdUsNoIjAQOSmkO6tWR5ka0WhpAONQkfIIc%3D&reserved=
>>0
>>
>> commit 9d20a649a7d417ca62724c98f3906c0d160172ae
>> Author: Harbs <ha...@in-tools.com>
>> AuthorDate: Sun Oct 29 01:41:08 2017 +0200
>>
>>    Revert "Updating the source of an ArrayList does not change the view
>>of the component without this change."
>>
>>    This reverts commit 313cf14147dfdd53b621b82b949b8544d2b6ed91.
>> ---
>> .../org/apache/royale/html/beads/models/ArrayListSelectionModel.as
>> | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git 
>>a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>>b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> index ec10892..81c606c 100644
>> --- 
>>a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> +++ 
>>b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/
>>models/ArrayListSelectionModel.as
>> @@ -84,6 +84,7 @@ package org.apache.royale.html.beads.models
>>          */
>>                public function set dataProvider(value:Object):void
>>                {
>> +            if (value == _dataProvider) return;
>>
>>             _dataProvider = value as IArrayList;
>>                        if(!_dataProvider || _selectedIndex >=
>>_dataProvider.length)
>>
>> --
>> To stop receiving notification emails like this one, please contact
>> "commits@royale.apache.org" <co...@royale.apache.org>.
>


RE: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

Posted by Yishay Weiss <yi...@hotmail.com>.
Currently the composite view (DataGridView) has some code designed to propagate the data change event to its subviews (DataGridColumnList). I think we need to move this code to a separate bead. Then we’ll have finer control over whether or not changes in runtime are reflected in the view. I’ll try to create a branch demonstrating this.



________________________________
From: Harbs <ha...@gmail.com>
Sent: Sunday, October 29, 2017 1:48:19 AM
To: dev@royale.apache.org
Subject: Re: [royale-asjs] 02/02: Revert "Updating the source of an ArrayList does not change the view of the component without this change."

This change made updating the dataProvider in the DataGridExample work, but it seems to have caused an endless recursive layout in some cases.

I’ve reverted it because it seems to have broken existing apps, but I’m not completely sure why.

I’m left with the question of how to allow changes to ArrayLists propagating to the view without causing the endless loop…

> On Oct 29, 2017, at 1:43 AM, harbs@apache.org wrote:
>
> This is an automated email from the ASF dual-hosted git repository.
>
> harbs pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
> commit 9d20a649a7d417ca62724c98f3906c0d160172ae
> Author: Harbs <ha...@in-tools.com>
> AuthorDate: Sun Oct 29 01:41:08 2017 +0200
>
>    Revert "Updating the source of an ArrayList does not change the view of the component without this change."
>
>    This reverts commit 313cf14147dfdd53b621b82b949b8544d2b6ed91.
> ---
> .../org/apache/royale/html/beads/models/ArrayListSelectionModel.as       | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> index ec10892..81c606c 100644
> --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/ArrayListSelectionModel.as
> @@ -84,6 +84,7 @@ package org.apache.royale.html.beads.models
>          */
>                public function set dataProvider(value:Object):void
>                {
> +            if (value == _dataProvider) return;
>
>             _dataProvider = value as IArrayList;
>                        if(!_dataProvider || _selectedIndex >= _dataProvider.length)
>
> --
> To stop receiving notification emails like this one, please contact
> "commits@royale.apache.org" <co...@royale.apache.org>.