using code with table

  • MAboudi

    MAboudi - 2007-11-17

    hello, thanx for this new release.
    i want to know if i can acces detail rows from a master table (from code).
    and if possible a list of all event that i can use from code(of table).

    • Danilo Limatola Esterno


      form code table you have a global object thisTable this is some methods:

      thisTable.getValue(<Column Name>)  //return value of column the for current row
      thisTable.getSubTable(<SubTable Name>) //return SubTable
      thisTable.getSubTable(<SubTable Name>).getValue(<row>,<Column Name>) //return value of the column for row
      thisTable.getSubTable(<SubTable Name>).getRowCount() //return number of rows

      for other methods you can see the java source the class dataweb.datastore.Table

      this is a list of event:
      beforeEdit(e){} //this automatically called before edit row. Tipically used to check if row is editable.
                        e.getTable() // return table

      beforeAddNew(e){} //this automatically called before add new row. Tipically used to check if can add row.
                        e.getTable() // return table

      beforeSetValue(e){} this automatically called before a column setting value. Tipically used to check value.
      afterSetValue(e){} this automatically called after a column setting value.
                         e.getTable() // return table
                         e.getColumName() // return column name
                         e.getValue() // return column value

      beforeUpdate(e){} //this automatically called before update row. Tipically used to check if row is valid.
                       e.getTable() // return table

      this is a transaction event called when database storing data:

      beforeInsertTransaction(e){} //Insert row
      afterInsertTransaction(e){} //Insert row
      beforeUpdateTransaction(e){} //Update row
      afterUpdateTransaction(e){} //Update row
      beforeDeleteTransaction(e){} //Remove row
      afterDeleteTransaction(e){} //Remove row

      If you use table with subtable these events run only from code of root table for ex:

        if (e.getTable()==thisTable){
           //beforeSetValue of root table
        }else if (e.getTable()==thisTable.getSubTable(<SubTable Name>)){
           //beforeSetValue of sub-table <SubTable Name>

      For any question please submit new post 
      Thank you 
      Danilo Limatola


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks