Providing description attributes for binding namespaces in the web UI framework

The namespaces attribute on a screen provides information about the namespaces that have been used for binding controls. Customizers can view the namespaces and their descriptions (if provided by the developers) in the Control Details View of the Extensibility Workbench or the Properties window in the Designer Workbench. They do not have to open the JavaScript source files to view the namespaces.

The namespaces attribute is an object with two attributes (source and target) which individually are arrays of an object. In older screens, this attribute is an object with two attributes (source and target) which individually are arrays of a string. You can use the Designer Workbench to update the namespaces structures of older screens to use object arrays instead of string arrays.

The following shows the namespaces structure:

namespaces: {
     source: ['a', 'b']
     , target: ['c', 'd'] 
} 
, namespacesDesc: {
     sourceDesc: ['description for a', 'description for b']
     , targetDesc: ['description for c', 'description for d'] 
}

The namespaces are saved under the namespaces object while the descriptions are saved under the namespacesDesc object. There is a one-to-one mapping between the contents in namespaces and namespacesDesc. This maintains backward compatibility with older applications that used a different namespaces structure.

An older screen that uses the different namespaces structure is upgraded in the Designer Workbench and the new structure is written to the JavaScript and JavaScript Object Notation files. The user receives a prompt, and on confirmation the update finishes. Once updated, the file can no longer be opened in an older version of the Designer Workbench. The new contents are written into the js and json files once the user saves them using the Save button.

After updating, the description field for both the source and the target will default to, respectively, Description for <source name> and Description for <target name>.

With older screens where namespaces were not provided in the Designer Workbench and not present in the js and json files, this upgrade generates the following js file:

namespaces: {
     target: []
     , source: [] 
} 
, namespacesDesc: {
     targetDesc: []
     , sourceDesc: [] 
}

With these kinds of screens, you should provide a one-to-one mapping between the bindingData source and target arrays with namespacesDesc. In extensibility, if namespacesDesc has non-empty values while namespaces is empty, values are displayed corresponding to bindingData.