validateCell() not fired

Help
Costa
2012-03-11
2012-12-13
  • Costa
    Costa
    2012-03-11

    I have a form  containing one combobox and a simple grid of 2 columns. When the form is opened for the first time there is no combo box selected item, so the grid has no data loaded. When the user selects a combo box item,  some records are retrieved from the database and loaded into the grid. The grid has no associated buttons and it is opened for EDITING for all records, edit OnSingleRow =false, allowInsertInEdit =true. There is a GridController code fragment

       @Override
        public Response loadData(int action, int startIndex, Map filteredColumns, ArrayList currentSortedColumns, ArrayList currentSortedVersusColumns, Class valueObjectType, Map otherGridParams) {

            ArrayList list = new ArrayList();
           
            if (selected_company != null) {

                Connection conn = ca.conn_ora;
                Properties props = null;
                Statement stmt = null;
                ResultSet rst = null;

                props = ca.props;
                StringBuffer sql = new StringBuffer(255);

                sql.append(props.getProperty("sql3"));
                sql.append("'" + selected_company + "' order by fiscalyear");
                try {
                    stmt = conn.createStatement();
                    rst = stmt.executeQuery(sql.toString());
                    while (rst.next()){
                        XACAE_VO vo = new XACAE_VO();
                        vo.setFiscalyear(rst.getInt(1));
                        vo.setKostos_amesis_ergasias(rst.getBigDecimal(2));
                        list.add(vo);
                    }

                    rst.close();
                    stmt.close();
                } catch (SQLException ex) {
                    Logger.getLogger(ClientApplication.class.getName()).log(Level.SEVERE, null, ex);
                }
               
           
            }
            volistresponse = new VOListResponse(list,false,list.size());
            return volistresponse;
        }

    and there is a piece of code from the form class

    /* Εδώ πιάνει την επιλογή της εταιρείας */
    private void cb_item_changed(java.awt.event.ItemEvent evt) {                                
       
        String company = " ";
       
        if (evt.getStateChange() == ItemEvent.SELECTED)
            if (comboBoxControl1.getValue() != null) {
                company = comboBoxControl1.getValue().toString();
                this.reload(company);
        }
    }                               

    private void reload(String company){
       
        //Καθαρίζει το grid table model
        gridControl1.getTable().getVOListTableModel().clear();
       
        gc.setCompany(company);   // σετάρει την τρέχουσα επιλεγμένη εταιρεία
        gridControl1.getTable().executeReload();    //καλεί το loadData του GridController
        gridControl1.setMode(Consts.EDIT);  //το grid βρίσκεται μονήμως σε edit mode
       
    }

    gc … is instance of GridControlle class.

    Having this scenario, the validateCell() calback method is not fired at all.

    Could anybody help?  Thank you.