Dialog and commands

148 views
Skip to first unread message

zydor - Michał Czaja

unread,
Mar 11, 2014, 2:58:32 PM3/11/14
to codenameone...@googlegroups.com
Hello

I have a question about using commands attached to buttons added to dialog layout. I spot that every button click causes dialog close.

So my question is if anybody have knowlage about handling this commands without dialog close. 
E.g. when I wand to do some wizard on dialog I click a button and the dialog content will change without dialog closing.


Shai Almog

unread,
Mar 11, 2014, 4:01:46 PM3/11/14
to codenameone...@googlegroups.com
Hi,
commands default to closing dialogs buttons do not. You can use a regular button with an action listener and it will have no effect.
You can also set a dialog to auto-dispose false using setAutoDispose() which blocks that.

zydor - Michał Czaja

unread,
Mar 11, 2014, 4:44:04 PM3/11/14
to codenameone...@googlegroups.com
Thx Shai, as always I can rely on your quick answers... ;) 

crowm...@gmail.com

unread,
Mar 18, 2014, 7:01:27 PM3/18/14
to codenameone...@googlegroups.com
I love using your quick Dialog/Command methods to build a simple dialog.  I have a login dialog that I don't want to automatically dispose of on OK because I have to verify the login and password.  But I can't seem to do this without building my own Dialog and command buttons from scratch.  Is that correct?

Shai Almog

unread,
Mar 19, 2014, 2:41:43 AM3/19/14
to codenameone...@googlegroups.com, crowm...@gmail.com
It isn't trivial to do this with the builtin dialogs. Since the builtin dialogs return a command usually (e.g. user pressed cancel) that won't make much sense.
What we do is let the dialog dispose show the infinite progress for login.
If login failed we just call the show method again with the error message.
Reply all
Reply to author
Forward
0 new messages