0 Replies Latest reply on Nov 24, 2017 5:10 AM by arosse RSS
    arosse Newbie

    How to control the validity of a custom widget property?

    I am developing a custom widget allowing to print an infotable. The infotable has a property DataToPrint with the following attributes:

    'DataToPrint': {

                        'description': 'Data to be formatted to print inside a grid',

                        'defaultValue': '{}',

                        'baseType': 'INFOTABLE',

                        'isBindingTarget': true

                    }

     

    I would like to check the datashape of the property when binding it. The datashape must be two string fields "name" and "value". If the data bound do not correspond to this datashape, I want to reset the binding.

     

    I tried to use the afterAddBindingSource(bindingInfo) function to perform the test. The binding info parameter contains one field "targetProperty" indicating the propertyName that was just bound. I get the right name, however, when trying to get the property value with this.getInfotableMetadataForProperty('DataToPrint') I get an empty object. I assume the property is only updated after the function call.

     

    Does someone have an idea on how to make this verification?

     

    Thanks,
    Antoine