

Also, the array passed as the second argument to “puicustom.initWidget” in the property setter would need another string containing the other bind-able property name. You would map a Profound UI property to another call to a PrimeUI method via “widgetAccessor”. Note that if you wanted other properties to be bound (in the Profound UI meaning of bind), then support for those could be added to the getter in a different “if” block. It maps the Profound UI “value” property to the PrimeUI rating widget’s “getValue” method via our accessor utility.

(See the “pui.beforeRespond” function definition in the custom-widget-autobind.js file from the previous article.) Essentially, we use “bind” to provide extra information to the function without changing its parameters.
#PREF SETTER SETTINGS CODE#
The widget’s main DIV element is passed to bind, allowing calls to the new function to reach the DIV via the “this” variable.īinding is necessary in this case because some custom code calls the “getCustomPropValue” function when the screen is submitted, and only the property name parameter is passed. Like with our event handlers, bind() is creating a new function from an existing one-“” in this case. The purpose of the getter is to pass data from the widget to Profound UI when the screen submits so that the data can be sent to the server. The last thing to mention from the property setter function is “getCustomPropValue”, the getter function:
#PREF SETTER SETTINGS HOW TO#
This article will explain the final steps to setting up the property setter function and how to add the toolbox definition. Not only will these widgets be usable in your production environment, you can also see them rendered in design-time in Visual Designer for drag and drop design.

This series will explain how you can use widgets from a separate, unrelated library of widgets-PrimeUI-so that you can populate these widgets with data from a server and submit data from the widget back to the server. Catch up on the steps we covered in Part I here, and Part 2 here. Welcome back to our guide on using widgets inside of Profound UI.
