On Tue, Jul 7, 2009 at 4:20 PM, Paul McNett<p...@ulmcnett.com> wrote:
> Ed Leafe wrote:
>>       I've never been able to run a dForm as a modal dialog. The error is
>> occurring in the code that attempts to make the form into a dialog
>> temporarily, and then turn it back into a form.
...
> That said, I do use this in my app and it seems to work just fine. I
> wanted to be able to instantiate a datanav.Form modally so I could use
> it as a "pick list". So, I have a customers form defined for modifying
> customer records. Now I can re-use that form to choose a customer from,
> say, the orders module by doing:
>
> frmPickCust = app.ui.FrmCustomers(self, FormMode="picklist", Modal=True)
>
> I've probably been doing this for 2 years now with an app in the field
> without trouble (although I've suspected the hack sometimes and wasted
> cycles on it only to find a different root cause of a bug).
>
> Really, if you can avoid setting dForm.Modal (by just defining your form
> as a dialog instead), please do.

My problem is that dialogs are not bizobj aware, which limits usage;
for example, it is not possible to a complex picklist like those
moving elements from one list to the other, or allowing for editing
and creation without closing and re-opening the form (well at least
not without much work).

>> I'll wait for Paul to
>> comment on this, since I don't have any experience with this. I am
>> pretty certain that this hack was never tested with .cdxml forms.
>
> No I didn't test with cdxml. One of the requirements is that the Modal
> property setting be sent in the constructor, not in initProperties etc.
> Perhaps that's the problem?

I suppose I'm setting the Modal attribute at instantiation, since the
previous step should only create the class definition. Here's my
method:

# self is MainForm
def onNew(self, evt):
        EditContactDlg = dui.createClass('EditContact.cdxml')
        frm = EditContactDlg(self.Form, Modal=True)
        contactsForAccount = self.Form.getBizobj("contact")
        frm.showForm(contactsForAccount, 'NewRec')

Anyway, I'll try and code the dialog by hand.
Do you suggest another way of having a modal dialog that is bizobj aware?
Or the alternative is always fetching the record values from another
form (including next record if we want to allow multiple edits without
closing)?

Txs for the help,
Miguel


_______________________________________________
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/a19730800907071550o6e2713behf2d4121a4b7f0...@mail.gmail.com

Reply via email to