Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A Column converter can be contributed by a java plugin. To do this, the plugin must implement interface IColumnConverterProvider to produce IColumnConverter instances in the getColumnConverters() method, see http://www.servoy.com/docs/public-api/70x/com/servoy/j2db/plugins/IColumnConverterProvider.html.

An IColumnConverter converter has 3 methods, similar to the GlobalMethodConverter:

  • convertFromObject()
    Convert from Object value to database value
  • convertToObject()
    Converts from database value to Object value
  • type (one of TEXT, INTEGER, NUMBER, DATETIME or MEDIA)
    The Object data type (so the resulting type of the convertToObject()).

Calculations

A Calculation is very much like a database column, except that its value, rather than being stored, is dynamically computed each time it is requested. This is achieved by creating a JavaScript function which is bound to a database table. The function takes no arguments and returns a value, which like a real database column, is declared to be one of the five general data types. The scope of the JavaScript function is an individual record object. Therefore any of the record's other data providers, and related foundsets are immediately available, as well as global variables and globally related foundsets.

...

A UI converter can be contributed by a java plugin. To do this, the plugin must implement interface IUIConverterProvider to produce IUIConverter instances in the getUIConverters() method, see http://www.servoy.com/docs/public-api/70x/com/servoy/j2db/plugins/IUIConverterProvider.html.

An IUIConverter converter has 3 methods, similar to the GlobalMethodConverter:

  • convertFromObject()
    Convert from UI value to dataprovider value
  • convertToObject()
    Converts from dataprovider value to UI value
  • type (one of TEXT, INTEGER, NUMBER, DATETIME or MEDIA)
    The UI data type (so the resulting type of the convertToObject()).

See Creating See Providing UI converters from plugins for an example on how to implement a plugin which provides a UI converter.

...