On Thursday, February 09, 2012 07:58:21 PM Vineet Deodhar wrote:
> Consider a setup like this:
> 
> ParentTable: (parent_id, name, occu)
> ChildTable: (child_id, parent_id, name, qual)
> GrandChildTable: (gchild_id, child_id, name, age)
> 
> Table data is like this:
> 
> in ParentTable: (1, 'John', 'farmer')
> 
> in ChildTable: (1, 1, 'Bill', 'B.A.'), (2, 1, 'Black', 'M.A.')
> 
> in GrandChildTable: (1, 2, 'Noah', 23), (2, 2, 'George', 10)
> 
> My Problem---
> 
> In GrandChildTable,
> user deletes 2nd row.
> updates 1st row.
> Beforehand, I, of course, do not know what the user will do with records
> (update or delete).
> I know how to call the methods like new(), save(), delete(), seek() &
> setFieldVal() individually on table records.
> 
> Is there any way to make dabo call delete() on correct records and save()
> on correct records (without any extra coding from my side)?
> Maybe something like setDeleteFlag?
> 
> Otherwise I need to trace-out the records where data was there before
> user-interaction, and the data is absent after user-interaction.
> Then I can call delete().
> Otherwise I call save()
> (along-with requery(), seek(), setFieldVal())
> Similarly, I have to trace-out newly added records.
> 
> This becomes very complex.
> Definitely, dabo must be having a proper way to do this.
> 
> I request this list to help me out.
> 
> Thanks,
> 
> Vineet

Normally I setup the form to save() or delete() immediately - reacting to user 
input.  For example if the user decides to delete a grandchild record it 
happens immediately.

gradchild.delete() or self.delete(grandchild).
After the delete Dabo handles the requery() and updates the screen.

There are times or situations where additional actions must occur as the 
result of the delete.  I then add a delete() method in the bizobj to handle 
those special situations.

The same holds true for save().

Johnf

Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/110735569.GNktSc1gIy@linux-12

Reply via email to