In a qooxdoo application, the root object is the entire screen.
I believe that with inline object the root object is just as big as your
control, I don't think it is the entire screen like I am used to. This is
why you can't do everything that the demo browser can do. When you click
outside of the popup object in the demo browser, you are clicking on another
qooxdoo object, but when you click outside of your table you are not
clicking on a qooxdoo control so qooxdoo is not aware of the click. have you
tried attaching code to the blur event of the table? Blur is a basic event
that should fire when you click on something else on the page, at least in
theory it will. So using blur to know when you are no longer on the control
might work.

Remember, just because you have one qooxdoo control on your page does not
mean that qooxdoo is aware of everything else that is happening on the page.
What is on the rest of the page? Why don't you make the entire page a
qooxdoo page? This will make your life much easier.

Jim


On Fri, Mar 13, 2009 at 4:36 PM, Gene Amtower <[email protected]> wrote:

>  On Fri, 2009-03-13 at 14:54 -0700, Jim Hunter wrote:
>
> I don't know what demo you are looking at, but on the popup demo the
> objects, for me, stay visible until I click on something. They don't close
> on their own. And looking at the code, there is nothing to tell it to close
> after a given amount of time.
>
>
> No, I'm not expecting them to disappear after a time - I want them to
> disappear if I click somewhere else on the page, just like the production
> demo on popups found on the Qooxdoo site.  My popup tables stay visible
> after I click somewhere else - the demo popups stay there if you click on
> either the button or the popup, but they go away as soon as you click
> somewhere else.  I don't see anything in the demobrowser script code that
> drives the disappearance of the popup, so it seems automatic to me.  It's
> not happening automatically with my popup tables.
>
> My comment on a timer was to delay the forced hiding of the popup (100 ms?)
> from the loss of textfield focus (through an added "focusout" listener) long
> enough for my focus event on the table to alert the script that it has the
> focus (through an added "focusin" event listener), thereby avoiding the
> hiding of the popup table from the loss of textfield focus because the
> "focusout" event fires before the table's "focusin" event.  Got all that?
> In other words, I want the table to stay visible even when I move my focus
> to the table, but I want it to go away if I move my attention somewhere else
> on the page.  Seems simple enough, but it ain't workin' for me.
>
> As for having access to the main root object, the Inline documentation in
> the manual states that you can place objects in the document via <DIV> tags
> or through the main root object with absolute positioning.  So, I don't
> think I lose access to the main root object by using an Inline method.
> However, there might be some difficulty in setting event listeners in
> non-Qooxdoo app space - I could understand that being a problem.  However, I
> really thought Qooxdoo was just leveraging the existing Javascript space in
> the HTML document with its library, so I would expect events to interact
> normally between HTML-space and Qooxdoo-space as long as they are defined
> correctly.  I don't believe there's anything different about how we define
> event listeners in Qooxdoo and the suggested methods in Javascript embedded
> in the HTML page - the syntax looks exactly the same to me.
>
> Thanks for the thoughts,
>
>    Gene
>
>
>
>
> Since you are doing this inline, you are going to loose all the benefits,
> as far as I know, of the main root object. I don't think you have one in the
> same way a full qooxdoo application has one. There is no qooxdoo control
> managing clicks outside of your table so there is nothing that can get fired
> in order to hide your table. I think you are trying to squeeze 10 pounds
> into a 5 pound can. I don't do inline code so at this point I may not be the
> best person to answer all your questions, but I do know enough to know what
> you are trying to do is not going to be easy and you may need to combine
> some JavaScript outside of qooxdoo in order to come close to what you are
> trying to do. But in any event, it's not going to be easy, if it's even
> possible. Your best solution is to do the page as a full qooxdoo application
> and take your HTML and place it in a qooxdoo embed control. You might have
> better luck that way. Then you would have more control over click events
> outside your table control.
>
>
> Jim
>
>
> On Fri, Mar 13, 2009 at 1:46 PM, Gene Amtower <[email protected]> wrote:
>
> Yep, I'm currently fighting the "focus" race with these event routines -
> the table focus event is firing after the textbox blur event fires, so I
> can't set the property in time to prevent the table from hiding.  I might
> try using a timer to allow all of the focus/blur events to complete before
> calling a function to evaluate closing the popup windows.  I also tried to
> set an event on the "Root" object to detect a click outside of the Qooxdoo
> widgets, but that's not closing the popups:
>
>       // Add a focus listener
>       this.getRoot().addListener("click", function(e) {
>         onpopup.hide();
>         popopup.hide();
>       });
>
> I tried it with both the "focus" and "click" events, but it's obviously not
> firing when I click outside the Qooxdoo objects.  Again, this might be
> because I'm using the Inline method if implementation.
>
> I just wish I knew why the tables don't close on their own when I navigate
> away, like the demobrowser objects in the popup demo.
>
> Thanks for your thoughts,
>
>    Gene
>
>
> On Fri, 2009-03-13 at 13:29 -0700, Jim Hunter wrote:
>
> I would have bet that there was a method to see if an object has focus, but
> like you I couldn't find one. So doing what you suggest and create two event
> handlers for when the table gets/losses focus and setting a variable might
> work fine. At least that is the way I would do it if I was solving this
> problem. There is an event for activate/deactivate that you might look into
> if focus/blur don't work perfect. And you might want to add a slight delay
> in your test code because the slight amount of time it takes to move the
> activation from one control to another might be enough for your code to fail
> if it executes too quickly.
>
>
> Jim
>
>
> On Fri, Mar 13, 2009 at 11:13 AM, Gene Amtower <[email protected]> wrote:
>
> On Fri, 2009-03-13 at 09:28 -0700, Jim Hunter wrote:
>
> Inside the routine where you are hiding the table, make one additional
> check to see if the table has focus, and if it does not, then hide it. Then
> on the table object, when it losses focus you can hide it then. Something
> that I have done similar to your scenario, is that I pop up a window that I
> want to be displayed until something outside the window is clicked, and to
> handle this I added a click listener to the main page, and every time it is
> clicked it looks to see if my pop up is visible. If it is, it simply hides
> it. If not it does nothing.
>
>
> Jim
>
>
>
> Thanks, Jim.  I considered that but didn't know if I was missing something
> in my use of the Qooxdoo widgets.  How do you recommend testing for the
> focus on the table?
>
> I can't find a property for the focus state in Javascript, but I found
> something on the web about adding a custom variable to record the focus
> state of an object when it receives focus (using the focus event on that
> object).  Is there a better way using a Qooxdoo property that is
> automatically set with the focus state?  If there is, I can't find it in
> Qooxdoo either.
>
> Thanks,
>
>    Gene
>
>
>  On Fri, Mar 13, 2009 at 9:04 AM, Gene Amtower <[email protected]> wrote:
>
> Hello all,
>
> I'm creating popup table objects using Table.model.Simple, linked to user
> entry in a corresponding text field.  Eventually, the textfield values are
> going to cause the tables to get populated with appropriate data as the user
> types, but for now I'm just trying to get them to display and hide
> appropriately.  I'm incorporating these widgets into my page using the
> "Inline" method and corresponding DIV containers.
>
> The table is displayed correctly whenever I type in the textfield (using
> the "input" event), but it remains visible when I remove focus from the
> textfield.
>
> In the demobrowser example for popups, it uses Atom objects displayed
> through a button click event, and the popup objects disappear when the focus
> is removed from BOTH the button and the popup, but not before.  I've
> examined the js code in this demo, and I don't see anything special there to
> control the auto-hide of the popup.
>
> I finally added a "focusout" event listener on the textfield to hide the
> popup, and it works fine unless I want to click on something in the popup
> table.  In this case, the click in the table object is interpreted as a loss
> of focus on the textfield and the table closes.  I think this is because
> it's not a child of the textfield even though it's displayed by the
> textfield event.  I don't think I can add the popup table as a child of the
> textfield to prevent this because it is already added to the popup object.
> It would not make sense to "add" an object to two different containers,
> right?
>
> How do I get the tables to close whenever I click outside of the textfield
> or table, but remain as long as I'm "focused" on one of these two objects.
>
> Here's the popup code I'm using:
>
>       // Create popup order table
>       var ordertableModel = new qx.ui.table.model.Simple();
>       ordertableModel.setColumns([ "Order", "Customer", "Date" ]);
>       var ordertable = new qx.ui.table.Table(ordertableModel);
>       ordertable.set({width: 400, height: 400, decorator: null});
>
>       // Now create the popup container for ordernumbertable
>       var onpopup = new qx.ui.popup.Popup(new qx.ui.layout.Basic());
>       onpopup.add(ordertable);
>
>       // Add a popup listener
>       orderno.addListener("input", function(e) {
>         onpopup.placeToWidget(orderno, true);
>         onpopup.show();
>       }, this);
>
>       // Add a popup listener
>       orderno.addListener("focusout", function(e) {
>         onpopup.hide();
>       });
>
> BTW, I've added two different textfield/table pairs in my page, and when I
> click on the second textfield, the popup table from the first textfield
> remains visible, even when the popup table from the second textfield is
> displayed, but if I click within the second popup table, THEN the first
> popup table goes away.
>
> Am I missing something basic in the popup object settings?  Is this because
> I'm using the Inline method instead of an application method?  Or is
> something not working as it should?
>
> Thanks,
>
>   Gene Amtower
>   PC Backup
>
>
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> ------------------------------------------------------------------------------Apps
>  built with the Adobe(R) Flex(R) framework and Flex Builder(TM) arepowering 
> Web 2.0 with engaging, cross-platform capabilities. Quickly andeasily build 
> your RIAs with Flex Builder, the Eclipse(TM)based developmentsoftware that 
> enables intelligent coding and step-through debugging.Download the free 60 
> day trial. 
> http://p.sf.net/sfu/www-adobe-com_______________________________________________
>  qooxdoo-devel mailing list [email protected] 
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> ------------------------------------------------------------------------------Apps
>  built with the Adobe(R) Flex(R) framework and Flex Builder(TM) arepowering 
> Web 2.0 with engaging, cross-platform capabilities. Quickly andeasily build 
> your RIAs with Flex Builder, the Eclipse(TM)based developmentsoftware that 
> enables intelligent coding and step-through debugging.Download the free 60 
> day trial. 
> http://p.sf.net/sfu/www-adobe-com_______________________________________________
>  qooxdoo-devel mailing list [email protected] 
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to