How to dispose a Form when spawned by dialog

10 views
Skip to first unread message

Mark Bolduc

unread,
Jan 14, 2020, 5:23:43 PM1/14/20
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA Netbeans 11
Desktop OS Windows 10 Pro
Simulator Latest
Device ALl

I have a case where I spawn a Form from a dialog (list of stuff)
When the Form finishes creating an appointment, I want to be returned to the Dialog.

Thoughts?

Regards.

Shai Almog

unread,
Jan 14, 2020, 9:23:14 PM1/14/20
to CodenameOne Discussions
You'll need to show a new dialog instance on this new form. Forms aren't disposable.
Generally I'd advise re-thinking the UX here. Dialogs are meant to be small interactions for OK/Cancel sort of stuff. If you have more functionality there you should probably put it in a Form.

Mark Bolduc

unread,
Jan 17, 2020, 11:53:59 AM1/17/20
to CodenameOne Discussions
Thanks, Dialogs work great for my application as (for example) editing inventory in a form can spawn multiple dialogs.
This works especially well as when the Dialog is disposed, I am returned to the Form w/o having the overhead of reloading that form.

briefly, what is the the programaticall concern of using a Dialog for more than just a confirmation mechinism?

Thanks in advance.

Regards.

Shai Almog

unread,
Jan 18, 2020, 12:46:06 AM1/18/20
to CodenameOne Discussions

Mark Bolduc

unread,
Jan 19, 2020, 10:41:02 AM1/19/20
to CodenameOne Discussions
Thanks.

I am comfortable witha modal Dialog being more than a confirmation mechinism.

For now, I will stay away from the interactive dialog for the very reasons stated in the  document you provided.

Thanks for the referance.

Regards.

On Saturday, January 18, 2020 at 12:46:06 AM UTC-5, Shai Almog wrote:
Reply all
Reply to author
Forward
0 new messages