On Feb 7, 2010, at 8:54 AM, sim wrote:
> I have a table with multiple foreign keys.
>
> a) How can I mark multiple fields as the LinkField?
The LinkField is set on the child, or dependent, bizobj. A child can
only be dependent on a single parent.
> b) How does the parent know which Linkfield is related to it?
The parent doesn't care. It just needs to know that it has related
child bizobjs. The child knows what its LinkField is, and which field in the
parent it is related to: either the parent's PK (default), or the value in the
child's ParentLinkField.
> c) I have a parent form that opens a child form on button click, how
> does the child form set the bizobj to be the child of the parent form?
I'm not sure that setting a parent-child relation is appropriate here.
Instead, I would pass the parent PK (or whatever value the child is related to)
to the child form when it is created.
If you want two separate forms to remain related, you will have to
manage the connection yourself. When related bizobjs are on the same form, the
form only needs one update to refresh the UI. If the child is on a separate
form, the parent bizobj will call the child's requery(), but only the parent
form will be told to update its display. You'll probably have to add code to
the parent form's afterPointerMove() method to call the child form's update()
method.
> d) Is there an example of a fairly complex bizobj that I can learn from?
I don't know of any that have been published for all to see, but
perhaps someone will volunteer to post theirs. However, I think that once you
get a little better understanding of how releations work in Dabo (you seem to
be approaching them backwards), what appears to be complex now will be greatly
simplified.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
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/[email protected]