MaestroThe UI design product. | Form Builder | All versions This feature is related to all versions.
Maestro provides the Data-Driven Dropdown component that allows you to build dynamic selection lists to implement various customer requirements.
The following properties are available to the Data-Driven Dropdown component:
Field Ref dataPath
Label labelField
Text valueField
Icon icon
Boolean addBlankValue
Text placeholder
Help Text
helpText
You can also configure a Data-Driven Dropdown component to be triggered by an input to a Text Field component. In this case, you have to use the input from a text field to both trigger and make a dynamic data services (DDS) call. This DDS call will retrieve the data to populate the data-driven dropdown.
Let’s take a closer look at how to do this. The example below uses a zip code text field where the user types the zip code and a zip code lookup service returns the list of cities in a zip code and populates them in the Data-Driven Dropdown component.
To do so, you need to:
{"cities":[{"label":"city1","value":"city1"},{"label":"city2","value":"city2"}]}
zipcode
.cityDataField
.data.cityDataField
.// The key "ZIPCODE" is the input parameter for the "Zipcode Lookup Service"
var inputFieldRefs = [{
key: "ZIPCODE",
ref: "data.zipcode"
}];
// The key "cities" is the output parameter returned from the "Zipcode Lookup Service"
var outputFieldRefs = [{
key: "cities",
ref: "data.cityDataField"
}];
var serviceName = "Zipcode Lookup Service";
var dataParams = Form.convertToFieldDataMap(inputFieldRefs, data);
// Character input must be length of valid zipcode before making request
if(data.zipcode && data.zipcode.length === 5) {
proceed();
}
// Lookup promise
function proceed() {
// Make asynchronous call to DDS and when the response is received set the field data or log an error
DynamicData.call(serviceName, dataParams).then(function(response) {
// Update the form field data.cityDataField with the response data formatted for a Data-Drive Dropdown.
Form.setFieldDataFromResponse(outputFieldRefs, response, data);
}).catch(function(err) {
console.log("Error: ", err);
});
}
Next, learn about the Dropdown component.