Alerts loosing Focus When using Context Menu Items

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Alerts loosing Focus When using Context Menu Items

Santosh
Hi,

I am popping up one Alert message using Context Menu Items. Alert is coming fine, But Once Alert message popped up, it is loosing its Focus. Can Any help me in how to make sure Alert should not loose focus when they are opened from Context Menu Items. Code that i have used for this functionality is as follows:

Action.getNamedActions().put("openAction", new Action() {
            @Override
            public void perform(Component source) {
                Alert.alert("Opening.", MyClass.this.getWindow());
            }
});

Here MyClass is the Class Name in which iam using this code and this MyClass extends BoxPane and "openAction" is a Menu.Item .


--
Thanks & Regards
B.S.V.S.Pavan Raju.
Skype: skype_pavan1
Hyderabad.
santosh pavan raju
Reply | Threaded
Open this post in threaded view
|

Re: Alerts loosing Focus When using Context Menu Items

Sandro Martini
Hi,
sorry it's a case I have never seen (could be something to fix) ...
could you post a minimal sample so we can look it directly ?

As a workaround I suggest to try to force some focus-related method
but I'm not sure it can works.

Thanks,
Sandro


2014-01-29 7:12 GMT+01:00 V SANTOSH PAVAN RAJU Bs <[hidden email]>:

> Hi,
>
> I am popping up one Alert message using Context Menu Items. Alert is coming
> fine, But Once Alert message popped up, it is loosing its Focus. Can Any
> help me in how to make sure Alert should not loose focus when they are
> opened from Context Menu Items. Code that i have used for this functionality
> is as follows:
>
> Action.getNamedActions().put("openAction", new Action() {
>             @Override
>             public void perform(Component source) {
>                 Alert.alert("Opening.", MyClass.this.getWindow());
>             }
> });
>
> Here MyClass is the Class Name in which iam using this code and this MyClass
> extends BoxPane and "openAction" is a Menu.Item .
>
>
> --
> Thanks & Regards
> B.S.V.S.Pavan Raju.
> Skype: skype_pavan1
> Hyderabad.
Reply | Threaded
Open this post in threaded view
|

RE: Alerts loosing Focus When using Context Menu Items

Roger Whitcomb-2
In reply to this post by Santosh

Hi,

   We had similar problems in our application.  The issue is that the process of closing the context menu puts focus back on the window it was invoked from, which takes focus away from the alert or popup or any other dialog, for that matter.  We have a workaround, which involves a custom skin for the menu popups. 

   Maybe you could open up a JIRA issue for your case and we can work on getting a better fix into the next release.  But, probably we can put the workaround into that issue so you can try it (at least for now).

 

Thanks,

~Roger

 

From: V SANTOSH PAVAN RAJU Bs [mailto:[hidden email]]
Sent: Tuesday, January 28, 2014 10:13 PM
To: [hidden email]
Subject: Alerts loosing Focus When using Context Menu Items

 

Hi,

I am popping up one Alert message using Context Menu Items. Alert is coming fine, But Once Alert message popped up, it is loosing its Focus. Can Any help me in how to make sure Alert should not loose focus when they are opened from Context Menu Items. Code that i have used for this functionality is as follows:

Action.getNamedActions().put("openAction", new Action() {
            @Override
            public void perform(Component source) {
                Alert.alert("Opening.", MyClass.this.getWindow());
            }
});

Here MyClass is the Class Name in which iam using this code and this MyClass extends BoxPane and "openAction" is a Menu.Item .



--
Thanks & Regards

B.S.V.S.Pavan Raju.

Skype: skype_pavan1

Hyderabad.