It's hard for me to tell without a debugger. Try stepping over the code to 
understand the flow.


On Tuesday, January 12, 2021 at 11:25:03 AM UTC+2 P5music wrote:

> I think it is better for my app to create a further InteractionDialog.
> When I do so I have to manage the back command on toolbar.
>
> The user experience is to start from the main form, then call a second 
> form and there the first dialog is displayed.
>
> This is the code portion at the beginning of the method that shows the 
> second dialog from the first dialog:
>
> Toolbar toolbar=form.getToolbar();
> InteractionDialog dialog=new InteractionDialog();
> Command oldBackCommand=form.getBackCommand(); //no method 
> toolbar.getBackCommand()
> Command backCommand=new Command("Back") {
> @Override
> public void actionPerformed(ActionEvent evt) {
> toolbar.setBackCommand(oldBackCommand);
> form.setBackCommand(oldBackCommand);
> dialog.dispose();
> }
> };
>
> form.setBackCommand(backCommand);
> //or
> //form.setBackCommand(null);    same behaviour
>
> toolbar.setBackCommand(backCommand);
> ....
> ....
>
> What I get is that when the second dialog is displayed (full screen) and I 
> would click the back button, it is the same I would click the back button 
> on the form, so the previous form is shown back while I want to stay on the 
> current form with the first dialog displayed.
> I just wanted to dispose the second dialog to go back to the previous 
> dialog, not the previous form.
>
> What's wrong?
>
> Il giorno martedì 12 gennaio 2021 alle 03:41:51 UTC+1 Shai Almog ha 
> scritto:
>
>> You can re-show the dialog with animation disabled after the on show 
>> event. You can store state in client properties to track whether a form has 
>> a currently showing dialog.
>>
>> On Monday, January 11, 2021 at 8:53:01 PM UTC+2 P5music wrote:
>>
>>> In my CodenameOne app it can happens that a InteractionDialog is 
>>> displayed and from there a form is called with text inside, arranged in 
>>> three areas. 
>>> The dialog is a subclass of InteractionDialog in fact (CommandDialog), 
>>> that avoids showing a form for itself.
>>> When the second form is called from the CommandDialog it works but when 
>>> the showBack command is invoked the dialog disappears.
>>> I say "disappears" because when the form disposes itself the previous 
>>> form is displayed in its previous state, including the BrowserComponent 
>>> content and the CommandDialog, then the dialog disappears.
>>> So it seems that the disappearing could be avoided.
>>>
>>> I can open another InteractionDialog, but I would like to know what's 
>>> happening, and if there is the possibility to call a form and then coming 
>>> back to the CommandDialog.
>>> Thanks in advance
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/fb8b7353-09be-4668-bda2-70aa9bf95becn%40googlegroups.com.

Reply via email to