Table \ List \ Modal


I’m having a problem that I hope someone could help me with.

The thing is,

I have a Async Table that reads from a content provider. The provider is a provider for an ArrayList.

Whenever I select a row from the table and press a button that I’ve named “Edit”, a modal pops up for editition.

Inside that modal is an HTML input that its value is something like myprovider.selectedRows[0].text. The modal has lazy load and refresh on show.

Supose that I’ve changed the text on the HTML input but now I want to reload back. I press the Cancel button (One-Way Toogle Button). The problem is that it seems that when I’m typing inside the HTML input I’m actually changing the text inside the content provider making it impossible to reload back changes I’ve made.

In my opinion writing on the content provider itself should only be made only when pressing the Apply button (by making an action that would update the provider) and not dynamically when I’m typing.

Any ideias?

Thank you

Just found another way to do it.


If you have a chance, do you mind describing the alternative approach you took?


The solution that I’ve found is:

Before the modal pops ups I’ve made a copy of the selected row on the provider. Then I’ve changed the value on the HTML input so that it uses the COPY and not the selected row on the provider. Now if I want to reload back changes I just have to discard the copy, else if I want to apply changes I just have to replace the selected row on the provider with the changed copy.

Nice. Thanks for sharing!