cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to control the validity of a custom widget property?

arosse
4-Participant

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

1 REPLY 1

Antoine,


Are you trying to check the incoming infoTable dataShape ?

Top Tags