Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Creating custom FieldTypes

    I am trying to create custom FieldTypes to be configured in a DataSource XML, so that some customization for our environment can be created. I can't find a good example for subclassing SimpleType (only zipcode with added validator).

    We want 2 behaviours:
    1. When using a boolean field, we like the checkbox in forms, but it saves it as a text with "true" or "false", and we need 1 or 0 in a number field.
    2. We need to display short Hex data which is saved in the DB as RAW type (not text). So the user will input and look at hex strings, and we will save this in the datasource as byte[].

    Is that possible by subclassing SimpleType, or do we need to modify ListGrid?

    Thanks!

    #2
    does anyone here has an idea?

    I don't want to create specific Editor and configure them per ListGrid because it's a system wide preferred behaviour.

    Comment


      #3
      Isomorphic?

      Comment


        #4
        This is not related to SimpleType.

        1. See DataSourceField.sqlStorageStrategy

        2. If you want this as a reusable type, use serverConstructor to create a subclass of SQLDataSource that transforms data to hex based on whatever custom property you might set. The Custom DataSource sample that uses Hibernate shows use of a custom property "mappedBeanClass" for instance.

        Comment

        Working...
        X