webOS-ports/org.webosports.app.memos — pull request #7 by mobileteck (2013-11-24 09:32:11+00:00)
Title: Delete and Duplicate bugs fixed for WebOSPorts Memo App

Hi,

I have fixed the following bugs in memo app.

http://issues.webos-ports.org/issues/343
http://issues.webos-ports.org/issues/345
http://issues.webos-ports.org/issues/355

In addition I have also separated out each kind to its own file for easier readability and maintenance.

The root cause of both duplicate and delete bug seemed to be related to changing panel components directly. I found that if you iterate through an array and remove an element while iterating the rest of the iterations fail as you have changed the underlying data model, so the indexes are out of sync.

So I changed it to always operate on the underlying model objects and reconstruct the UI components from that. I thought this will be better as it removed the need for setting a GC flag in the UI component a rely on the transition end to remove it.

Tested the changes on Chrome (Windows) and Pre3.

Regards,
Roshan