On 9/30/10 8:05 PM, Bronwyn Woods wrote:
> I have a bizobj with a validateRecord method.  When the validateRecord
> method fails (returns a string), a "dabo.dException.BusinessRuleViolation"
> is printed to the console with the correct error message.  But I can't
> figure out how to get a dialog to appear or the form's status bar to change.
>   The PyCon tutorial seems to suggest this should happen automatically, but
> since I'm hand coding my forms I probably missed a step.  Can you tell me
> what the process is for getting that message propagated appropriately?

If you are using dForm it should do that automatically when you try to save the 
record.

> Also, does anyone have an example of a (hand coded) simple dialog being
> instantiated and then returning a value to a form?  I'm completely unclear
> on how that would work, so an example would be very helpful.

Here's what I do:

dlg = MyDialog(self)
dlg.showModal()
# the next code runs only after the dialog's been hidden
retVal = dlg.myAttribute
del(dlg)

I code my dialogs to not release themselves, but to only hide, so the caller 
still 
has access to the dialog and can even show it again without reinstantiating 
which is 
a great performance optimization.

Paul
_______________________________________________
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]

Reply via email to