Skip to main content
11-Garnet
December 10, 2020
Solved

Widget Development - Resolve Binding in Design Time

  • December 10, 2020
  • 1 reply
  • 1196 views

I would like to access the data from the infotable bound to my widget during design time (ide).

Are there any JS functions I can use? I saw there are some observers on the 'isBindingTarget':true properties but really would be thankful for some pointer in the right direction.

 

Best answer by bmihaiciuc

Hello,

 

There are two key methods you could look into:

  • afterAddBindingSource is a method that you can implement in your widget object. It will be invoked by the platform whenever a binding source is added to any of your widget's infotable properties.

 

this.afterAddBindingSource = function (bindingInfo) {
 const propertyName = bindingInfo.targetProperty;
}

 

 

 

  • getInfotableMetadataForProperty is a method that is available as part of the widget API that you can invoke to retrieve the data shape fields of any infotable property that has an active binding. This is something you can invoke from afterAddBindingSource, but also at any other point in your IDE object:
    this.afterAddBindingSource = function (bindingInfo) {
     const propertyName = bindingInfo.targetProperty;
     const dataShape = this.getInfotableMetadataForProperty(propertyName);
    }​

Hope this helps.

1 reply

5-Regular Member
December 10, 2020

Hello,

 

There are two key methods you could look into:

  • afterAddBindingSource is a method that you can implement in your widget object. It will be invoked by the platform whenever a binding source is added to any of your widget's infotable properties.

 

this.afterAddBindingSource = function (bindingInfo) {
 const propertyName = bindingInfo.targetProperty;
}

 

 

 

  • getInfotableMetadataForProperty is a method that is available as part of the widget API that you can invoke to retrieve the data shape fields of any infotable property that has an active binding. This is something you can invoke from afterAddBindingSource, but also at any other point in your IDE object:
    this.afterAddBindingSource = function (bindingInfo) {
     const propertyName = bindingInfo.targetProperty;
     const dataShape = this.getInfotableMetadataForProperty(propertyName);
    }​

Hope this helps.

gbirnzain11-GarnetAuthor
11-Garnet
December 10, 2020

This is exactly what I was looking for.

Thanks!