After reviewing the dabo-users archives and trying out stuff today, seems
like there are 3 ways a parent form and a child dialog can share
information:
1. The child dialog can be kept alive long enough (using the hide()
function) for the calling parent form to get information from objects on the
child dialog, after which the child can be closed, and the parent can make use
of the information.
2. The child dialog can write information back to properties on the parent
form before closing, after which the parent form can make use of the
information.
3. The child dialog can access the bizobjs of the parent form, and do all
the work there in the child dialog, before closing and returning control to
the parent.
We managed to get all three of these approaches to work in simple forms
today.
Number 1 is described in an earlier thread on okCancelDialogs.
For Number 2, we added a property to the calling form called SearchString,
and then the child dialog (this time based on the plain dialog in
ClassDesigner) OK onHit code wrote the contents of a textbox back to the
property
on the parent form:
self.Form.Parent.SearchString = self.Form.txtRunID.Value
self.Form.close()
the parent form then used the search string to move the pointer in a grid.
For Number 3, we did everything in the child dialog OK button onHit:
bizRuns = self.Form.Parent.getBizobj("runs")
bizRuns.seek(self.Form.txtRunID.Value,"run_id", False, True, True)
self.Form.close()
we left it for the calling program to refresh the grid.
There seems to be some debate on which approach is best. But all seem to
work fine.
Jonathan Poor
Rubin & Poor, Inc.
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
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]