> I changed my code to this:
>
> qx.Class.define("test1.KioskCheckinAgeTable",
> {
>   members:
>   {
>     setHostID: function(host_id) {
>       this.setAdditionalStatusBarText(" -- Loading --");
>       this.__jsonRecentLoginsFetcher.setUrl("/avg_checkin_times/" +
> host_id);
>       },
>     stopTimer: function() {
>       this.__timer.stop();
>       this.__timer.dispose();
>       }
>   },
>   extend : qx.ui.table.Table,
>   construct : function()
>     {
>       this.base(arguments);
>       this.setColumnVisibilityButtonVisible(false);
>       var tableModel = new qx.ui.table.model.Simple();
>       tableModel.setColumns([ "Date", "DelayAvg", "First", "Last" ]);
>       this.setTableModel(tableModel);
>       this.setColumnWidth(0, 70);
>       this.setColumnWidth(1, 61);
>       this.setColumnWidth(2, 55);
>       this.setColumnWidth(3, 55);
>       this.setStatusBarVisible(false);
>       this.__jsonRecentLoginsFetcher = new qx.data.store.Json(null);
>
>       this.__jsonRecentLoginsFetcher.addListener( "loaded",
>       function(e)
>       {
>         this.resetAdditionalStatusBarText();
>         var tData = e.getData();
>         var nativeData = [ ];
>         tData.toArray().forEach(
>           function(row)
>           {
>             nativeData.push(row.toArray());
>           });
>         var tableModel = this.getTableModel();
>         tableModel.setData(nativeData);
>         var row_count = tableModel.getRowCount();
>         this.setHeight(40 + 20 * row_count);
>       },
>       this);
>
>       this.__timer = new qx.event.Timer(60000); // 60,000 microseconds = 1
> minute
>       this.__timer.addListener("interval", function(e)
>       {
>         this.setAdditionalStatusBarText(" -- Loading --");
>         this.__jsonRecentLoginsFetcher.reload();
>       }, this);
>       this.__timer.start();
>   }
> });
>
> I made a listener on the Page that holds this Table that calls the new
> stopTimer member function.
> The console log tells me *this.__timer is null*. I don't understand why?

Well, it seems related to the life-cycle management of your class instances.

- Have set a debugger break point in the code that calls 'stopTimer'?
- What can you learn there about the state of the Table object?
- Is it still alive?
- Why doesn't it have a __timer member?
- Has it been properly initialized?
- Has its destructor already run?
- Why are you not calling 'stopTimer' in the destructor anyway? Wouldn't
that be a more suitable place for such a clean-up action?
- What happens in the code preceding the 'stopTimer' call?
- Is this in your Tabview-TabButton-Double-Click-Close-Tab handler you
talked about elsewhere?
- Are you destroying the tabview page in this handler, or are you just
hiding it?
- Is the Table already disposed, together with the tabview page? (Try
checking with .isDisposed()).
- ...

And so on ... these are just the first few things that come to mind. There
are too many options. You have to narrow it down.

T.



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to