Hi,

I was looking to replace the CellEditorFactory in the qx.ui.table.Table 
with a combobox and have been successful in principle. I created a class 
qx.ui.table.celleditor.ComboBox and the combox shows up nicely. I can 
also add ListItem widgets which display in the dropdown menu. I can also 
edit the value in the textfield.  However, when I try to select values 
from the dropdown, I get an error:

vFocusTarget has no properties
http://localhost/qooxdoo-0.7-sdk/frontend/framework/source/class/qx/event/handler/EventHandler.js
Line 920

The code of my CellEditorFactory follows. It is only minimally different 
from the TextField CellEditorFactory. I add it to the Table with

authConfigPropertyEditor.getTableColumnModel().setCellEditorFactory(2, 
new qx.ui.table.celleditor.ComboBox );

I also wonder if I have to create an appearance, and if yes, how to do this.

Thanks,

Christian


/**
 * A cell editor factory creating combo boxes.
 *
 * @appearance table-editor-combobox {qx.ui.form.ComboBox}
 */
qx.Class.define("qx.ui.table.celleditor.ComboBox",
{
  extend : qx.core.Target,
  implement : qx.ui.table.ICellEditorFactory,



  /*
  
*****************************************************************************
     CONSTRUCTOR
  
*****************************************************************************
  */

  construct : function() {
    this.base(arguments);
  },




  /*
  
*****************************************************************************
     MEMBERS
  
*****************************************************************************
  */

  members :
  {
    // interface implementation
    createCellEditor : function(cellInfo)
    {
      var cellEditor = new qx.ui.form.ComboBox;
      cellEditor.setAppearance("table-editor-combobox");
      cellEditor.setEditable(true);
      cellEditor.getField().setLiveUpdate(true);
      cellEditor.getField().originalValue = cellInfo.value;
      if ( cellInfo.value === null )
      {
        cellInfo.value = "";
      }
      cellEditor.getField().setValue("" + cellInfo.value);

      cellEditor.getField().addEventListener("appear", function() {
        this.selectAll();
      });

      cellEditor.getList().add(new qx.ui.form.ListItem("true"));
      cellEditor.getList().add(new qx.ui.form.ListItem("false"));
     
      return cellEditor;
    },

    // interface implementation
    getCellEditorValue : function(cellEditor)
    {
      var value = cellEditor.getValue();

      if (typeof cellEditor.originalValue == "number") {
        value = parseFloat(value);
      }

      return value;
    }
  }
});


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to