Hi,

I am running into trouble around runtime changes of the colums behind a table.
When the focused column has been set (e.g. by a user clicking the table) and it 
is for example the 10th column we experience runtime crashes when any kind of 
focus adjustment is done after the set of available columns is changed such 
that we have less columns than where the focus currently is.

Below the code that is executed in setFocusedCell. It first checks on isEditing 
which uses "getTableColumnModel().getVisibleX" given the focused column. This 
crashes because the column index is no longer valid.

In my opinion handling a change in metadata on the table should also look at 
the set of available columns and when the current focus is no longer valid 
reset it. Is this also a bug according to you? If so I will open a bugreport.

By the way, I am currently working with version 1.4.1 but the current code 
seems to do the same.

Kind regards,
Jeroen Smit

    /**
     * Returns whether currently a cell is editing.
     *
     * @return {var} whether currently a cell is editing.
     */
    isEditing : function()
    {
      if (this.__focusedCol != null)
      {
        var x = this.getTableColumnModel().getVisibleX(this.__focusedCol);
        var metaColumn = this._getMetaColumnAtColumnX(x);
        return this.getPaneScroller(metaColumn).isEditing();
      }
      return false;
    },

    /**
     * Sets the currently focused cell. A value of <code>null</code> hides the
     * focus cell.
     *
     * @param col {Integer?null} the model index of the focused cell's column.
     * @param row {Integer?null} the model index of the focused cell's row.
     * @param scrollVisible {Boolean ? false} whether to scroll the new focused 
cell
     *          visible.
     * @return {void}
     */
    setFocusedCell : function(col, row, scrollVisible)
    {
      if (!this.isEditing() && (col != this.__focusedCol || row != 
this.__focusedRow))
      {
        if (col === null) {
          col = 0;
        }

        this.__focusedCol = col;
        this.__focusedRow = row;

        var scrollerArr = this._getPaneScrollerArr();

        for (var i=0; i<scrollerArr.length; i++) {
          scrollerArr[i].setFocusedCell(col, row);
        }

        if (col !== null && scrollVisible) {
          this.scrollCellVisible(col, row);
        }
      }
    },



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to