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
  • Hi, you are right and now it works! My code is the following ("foods" is multiple, "choiceFoodType" and "fruitChoice" are single variables):= a!formLayout( label: "SAIL Example: Cascading Dropdowns", firstColumnContents: { a!dropdownField( label: "Food Type", choiceLabels: ri!foods, choiceValues: ri!foods, placeholderLabel: "--- Select Food Type ---", value: ri!choiceFoodType, saveInto: ri!choiceFoodType ), if( ri!choiceFoodType = "", {}, a!dropdownField( label: "Fruits", choiceLabels: rule!getFailureDescription( ri!choiceFoodType ), choiceValues: rule!getFailureDescription( ri!choiceFoodType ), placeholderLabel: "--- Select Fruit Type ---", value: ri!fruitChoice, saveInto: ri!fruitChoice ) ) }, buttons: a!buttonLayout( primaryButtons: a!buttonWidgetSubmit( label: "Submit" ) ))One strange behavior I notice is the following: I choose in 1st dropdown one value (ex. "Fruits"), in the 2nd I have filtered values (ex."Banana","Orange"). I select "Orange" and then I come back to the 1st dropdown and I change to another value (ex. "Vegetables"). It show a message "The Requested Task Is Not AvailableThe task may have been deleted or completed by another assignee.", but noone has taken the task because I am the only one in my test environment: maybe is it an error in my code? Thanks again!
Reply
  • Hi, you are right and now it works! My code is the following ("foods" is multiple, "choiceFoodType" and "fruitChoice" are single variables):= a!formLayout( label: "SAIL Example: Cascading Dropdowns", firstColumnContents: { a!dropdownField( label: "Food Type", choiceLabels: ri!foods, choiceValues: ri!foods, placeholderLabel: "--- Select Food Type ---", value: ri!choiceFoodType, saveInto: ri!choiceFoodType ), if( ri!choiceFoodType = "", {}, a!dropdownField( label: "Fruits", choiceLabels: rule!getFailureDescription( ri!choiceFoodType ), choiceValues: rule!getFailureDescription( ri!choiceFoodType ), placeholderLabel: "--- Select Fruit Type ---", value: ri!fruitChoice, saveInto: ri!fruitChoice ) ) }, buttons: a!buttonLayout( primaryButtons: a!buttonWidgetSubmit( label: "Submit" ) ))One strange behavior I notice is the following: I choose in 1st dropdown one value (ex. "Fruits"), in the 2nd I have filtered values (ex."Banana","Orange"). I select "Orange" and then I come back to the 1st dropdown and I change to another value (ex. "Vegetables"). It show a message "The Requested Task Is Not AvailableThe task may have been deleted or completed by another assignee.", but noone has taken the task because I am the only one in my test environment: maybe is it an error in my code? Thanks again!
Children
No Data