Populate/empty of dataBinderArray does not remove visual elements #228

Closed
opened 2021-03-11 08:21:52 +00:00 by jamie · 3 comments
jamie commented 2021-03-11 08:21:52 +00:00 (Migrated from git.hazaar.io)

If we try to populate data into a dataBinderArray that already contains data, the new data is put in place correctly, but the new visual elements are appended to the old ones. This is due to two problems:

  1. Populate does not call empty() internally, so there is no extra work done when emptying the array. We simply replace the internal element container with an empty one.
  2. The empty() method just removes elements from the internal element container. No extra work is done.

Fix should be, get populate to call empty() first to empty the array correctly. empty() can then be updated to remove elements in the same way that an unset() or pop() does which will pull the visual elements off the item list as well.

If we try to populate data into a `dataBinderArray` that already contains data, the new data is put in place correctly, but the new visual elements are appended to the old ones. This is due to two problems: 1. Populate does not call `empty()` internally, so there is no extra work done when emptying the array. We simply replace the internal element container with an empty one. 2. The `empty()` method just removes elements from the internal element container. No extra work is done. Fix should be, get populate to call `empty()` first to empty the array correctly. `empty()` can then be updated to remove elements in the same way that an `unset()` or `pop()` does which will pull the visual elements off the item list as well.
jamie commented 2021-03-11 08:21:58 +00:00 (Migrated from git.hazaar.io)

created merge request !117 to address this issue

created merge request !117 to address this issue
jamie commented 2021-03-11 08:21:58 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !117

mentioned in merge request !117
jamie commented 2021-03-11 08:22:48 +00:00 (Migrated from git.hazaar.io)

mentioned in commit a922680792862c125134f5177f8ded9dc6bc72b9

mentioned in commit a922680792862c125134f5177f8ded9dc6bc72b9
jamie (Migrated from git.hazaar.io) closed this issue 2021-03-11 08:22:48 +00:00
jamie self-assigned this 2025-09-04 01:15:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/framework#228
No description provided.