DA for Toffee question


(Alan Olson) #1

Given a DADataTable with one or more DADataTableRows in it…if I proceed to edit one fo the DADataTableRows using .Edit, and ultimately .post; to save the changes…do I need to call ApplyChangesForTable() after this also? or does post; call this for me to save the changes on the server?

The reason I ask is the following…

I had two rows in a DADataTable, and tried editing one of those rows using the above method, and then in the end I called applyChangesToTable on my DARemoteDataAdapter. the end result is that the edited data was saved to BOTH rows in my DADataTable instead of the one I intended it to be applied to.

help!


(marc hoffman) #2

.post applies there changes to the local DADatatableRow. .applyChangesForTable will upload them to the server. you need both, not necessarily at then same time. (ie when working off-line, you still wanna post, but not apply yet.

This of Post/Cancel as clicking OK/Cancel in the “Edit this record” dialog. Posts makes those changes permanent in the local table. Think of ApplyChanges as doing File|Save.

hm, that sounds fishy, can tie give me more exact steps?

fwiw, IIRC then calling applyChangesToTable will do a post in any rows that have pending changes (so thats why you might get away, albeit unclean, w/o calling post. But from what in recall how this al works, I dint see how the same change could, accidentally, be posted to two rows, since each row maintains its own state. I’ll need more details on what exactly is happening there…


(Alan Olson) #3

I believe I fixed it. Let me try to explain …

on my main form, I have two table views - master and detail, for lack of a better description. selecting a row in the top tableview, the detail for that shows up in the lower.

for some reason, I did something really stupid. in the tableview’s SelectionDidChange method, for some reason I changed it from using a case structure to using no case structure. as I said, it was stupid. when I reverted back to using the case statement, and therefore properly choosing the right DADataTableRow, things suddenly started to work. This still doesn’t explain why it was updating more than one row…but oh well.