Problematic popup

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

Problematic popup

Ilkka Oksanen
Hi,

Is there a standard solution for the problem visible in this example:


You can click the button and see a popup. That works fine. Now if you try to hide the popup by clicking the button for second time, things go wrong. I think it's because 'disappear' event is fired first which in my case deactivates the button, actual 'click' event will then activate the button again immediately after that.

I could remove the 'disappear' event handler but then the button state would be out of sync. Any elegant way to fix this? I couldn't find a similar question from the email archive.

         -ilkka





------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problematic popup

Richard Sternagel
Hi Ilkka,

what do you mean by:

> I could remove the 'disappear' event handler but then the button
> state would be out of sync.

The value of the widget represents the checked state. So in the
changeValue listener "e.getData()" gives you either checked (true) or
unchecked (false) which is all you need imho.

Due to the nature of the widget "qx.ui.toolbar.CheckBox" (which extends
"qx.ui.form.ToggleButton") it cares about the toggling by itself, so no
need for you to interfere (by use of an explicit "button.setValue(false)").

Regards
Richard

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problematic popup

Ilkka Oksanen

On Fri, Aug 23, 2013 at 2:49 AM, Richard Sternagel <[hidden email]> wrote:
Hi Ilkka,

what do you mean by:

> I could remove the 'disappear' event handler but then the button
> state would be out of sync.


I mean that if I click somewhere outside of the button and popup, the popup gets hidden (because of autohide true) but the button stays checked.

The value of the widget represents the checked state. So in the
changeValue listener "e.getData()" gives you either checked (true) or
unchecked (false) which is all you need imho.

Due to the nature of the widget "qx.ui.toolbar.CheckBox" (which extends
"qx.ui.form.ToggleButton") it cares about the toggling by itself, so no
need for you to interfere (by use of an explicit "button.setValue(false)").



I'm basically trying to do the same that qx.ui.form.MenuButton widget already does. But instead of Menu object that MenuButton wants, I have my own custom widget I want to show and hide. In my real code I have added this custom widget inside the popup. Could I still use MenuButton in this case?

         -ilkka


 

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problematic popup

rsantiagopaz
-  I have my own custom widget I want to show and hide. In my real code I have added this custom widget inside the popup. Could I still use MenuButton in this case?

beautiful dilemma.
Sorry my little interference (and sorry my english).
I (prefer) think there are (basically) 3 groups of this widgets:
1) Windows
2) Popups
3) Menus (strictly, "special popups").

2 and 3, or 2 and 2, never interact (basically, generally... of course). No standard solution because this "paradigm rules".
Regards, and sorry my unnecessary words without solutions.
Reply | Threaded
Open this post in threaded view
|

Re: Problematic popup

Richard Sternagel
In reply to this post by Ilkka Oksanen
Hi Ilkka,

> I mean that if I click somewhere outside of the button and popup, the
> popup gets hidden (because of autohide true) but the button stays checked.

Okay, now I see. You can achieve your wanted behaviour with the aid of
a blocker object, which blocks events:

http://tinyurl.com/l3r48jm

See also:
http://demo.qooxdoo.org/current/apiviewer/#qx.ui.core.Blocker

Regards
Richard

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problematic popup

Ilkka Oksanen

On Mon, Aug 26, 2013 at 5:49 AM, Richard Sternagel <[hidden email]> wrote:
Hi Ilkka,

> I mean that if I click somewhere outside of the button and popup, the
> popup gets hidden (because of autohide true) but the button stays checked.

Okay, now I see. You can achieve your wanted behaviour with the aid of
a blocker object, which blocks events:

http://tinyurl.com/l3r48jm

See also:
http://demo.qooxdoo.org/current/apiviewer/#qx.ui.core.Blocker

This is exactly what I need. Thanks!

         -ilkka


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel