In my Tempo tasks (7.4) I am trying to use cascading dropdowns with rules.

In my Tempo tasks (7.4) I am trying to use cascading dropdowns with rules.
I tried with this code (inputs:type and failure) but it doesn't work (my rule - getFailureDescription works).

= load(
local!type,
local!failure,
a!formLayout(
firstColumnContents: {
a!dropdownField(
label: "Type",
labelPosition: "ADJACENT",
required: true,
choiceLabels: {
"Tread",
"Wire"
},
choiceValues: {
"Tread",
"Wire"
},
value: ri!type,
saveInto: local!type
),
a!dropdownField(
label: "Failure",
labelPosition: "ADJACENT",
required: true,
choiceLabels: {
rule!getFailureDescription(
local!type
)
},
choiceValues: {
rule!getFailureDescription(
local!type
)
},
value: ri!failure,
saveInto: local!failure
)
...

OriginalPostID-96359

OriginalPostID-96359

  Discussion posts and replies are publicly visible

Parents
  • =load(
    local!selectedFoodType: tointeger(null),
    local!fruitChoice:tointeger(null),
    local!vegetableChoice,
    a!formLayout(
    label: "SAIL Example: Cascading Dropdowns",
    firstColumnContents: {
    a!dropdownField(
    label: "Food Type",
    choiceLabels: rule!getTypeExp(),
    choiceValues: rule!getTypeExp(),
    placeholderLabel: "--- Select Food Type ---",
    value: local!selectedFoodType,
    saveInto: local!selectedFoodType
    ),
    if(local!selectedFoodType = "",{},
    a!dropdownField(
    label: "Fruits",
    choiceLabels:rule!getFailureDescription(local!selectedFoodType),
    choiceValues: rule!getFailureDescription(local!selectedFoodType),
    placeholderLabel: "--- Select Fruit Type ---",
    value: local!fruitChoice,
    saveInto: local!fruitChoice
    ) )
    },
    buttons: a!buttonLayout(
    primaryButtons: a!buttonWidgetSubmit(label: "Submit")
    )
    )
    )
    This is my sale and this is the eroor it returns me:" Expression evaluation error at function a!uiSubmittableForm: A dropdown component [label=“Food Type”] has an invalid value for “choiceValues”. Duplicate items are not allowed in the choiceValues array."
Reply
  • =load(
    local!selectedFoodType: tointeger(null),
    local!fruitChoice:tointeger(null),
    local!vegetableChoice,
    a!formLayout(
    label: "SAIL Example: Cascading Dropdowns",
    firstColumnContents: {
    a!dropdownField(
    label: "Food Type",
    choiceLabels: rule!getTypeExp(),
    choiceValues: rule!getTypeExp(),
    placeholderLabel: "--- Select Food Type ---",
    value: local!selectedFoodType,
    saveInto: local!selectedFoodType
    ),
    if(local!selectedFoodType = "",{},
    a!dropdownField(
    label: "Fruits",
    choiceLabels:rule!getFailureDescription(local!selectedFoodType),
    choiceValues: rule!getFailureDescription(local!selectedFoodType),
    placeholderLabel: "--- Select Fruit Type ---",
    value: local!fruitChoice,
    saveInto: local!fruitChoice
    ) )
    },
    buttons: a!buttonLayout(
    primaryButtons: a!buttonWidgetSubmit(label: "Submit")
    )
    )
    )
    This is my sale and this is the eroor it returns me:" Expression evaluation error at function a!uiSubmittableForm: A dropdown component [label=“Food Type”] has an invalid value for “choiceValues”. Duplicate items are not allowed in the choiceValues array."
Children
No Data