Please use asynchronous request. Change your code like this:

qx.Class.define("myApp.classes.dao.TopMenuItemDao",
{
  extend: qx.core.Object,
  
  properties: {
    req: { init: null, check: "qx.io.request.Xhr" },
    reqData: { init: null, check: "object" },
    win: { init: null, check: "qx.ui.window.Window" , apply : "_applyWin"},
    surface: { init: null, check: "qx.ui.container.Composite" }
  },
  
  construct: function(surface){
    this.base(arguments);    
    this.setSurface(surface);
  },

  members :
  {      

        applyWin : function(value, old)
        {
                if(old){
                        old.destroy();
                }
        },

    initReq: function(url, method){
      this.setReq(new qx.io.request.Xhr(url, method));
      this.getReq().setAsync(true);
      
      this.getReq().addListener("load", function(e){
        //alert("load");        
      }, this);
            
      this.getReq().addListener("readyStateChange", function(e){
        //alert("readyStateChange");
      }, this);
      
      this.getReq().addListener("statusError", function(e){
        alert("statusError");
      }, this);
      
      this.getReq().addListener("success", function(e){
        //alert("success");
        var result = e.getTarget();
        this.setReqData(result.getResponse());
          this.getWin().close();
        this.setWin(null);
      }, this);      
    },
            
    getTopMenuItems: function(){   
      //alert(document.URL.split(":")[0] + "://" + location.host +
"/myApp/php/functions.php");   
      this.initReq(document.URL.split(":")[0] + "://" + location.host + 
"/myApp/php/functions.php", "GET");
      this.getReq().setRequestData({"function": "getTopMenuItems"});  
      
      this.getWin() = new qx.ui.window.Window("loading").set({width: 250,
height: 150});
      this.getSurface().add(this.getWin());
      this.getWin().open();

      this.getWin().addListener("appear", function(){
        this.getReq().send();        
      }, this);
    }
    
  }
});

-----Ursprüngliche Nachricht-----
Von: chrjab [mailto:[email protected]] 
Gesendet: Freitag, 17. Februar 2012 15:14
An: [email protected]
Betreff: Re: [qooxdoo-devel] Show window before sending a request

I already tried using a timer. It works, but it isn't a proper solution,
because then the window is flickering for a moment, even if the request
needs only some milliseconds to get an answer. If the requests would always
need some seconds, it would be ok, but this is not the case and I don't want
to see the window flickering with every request.

But there must be a way to do this. I've seen it in this application:

http://inventario-demo.paraguayeduca.org/build/index.html

username: admin
password: admin


There you can see a small window "waiting for request...". How can I realize
this?



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Show-window-before-sending-a-request-tp7290524p7294334.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to