Trigger saveInto when dynamically changing value in dropdown

Hello,

I have an interface that needs to show default value in dropdown for my users when some options are specified (see example below) 

  {
    a!DropdownField(
      label: "Toto dropdown",
      choiceLabels: {"1", "2", "3"},
      choiceValues: {1, 2, 3},
      value: ri!toto
    ),
    a!DropdownField(
      label: "Tutu dropdown",
      choiceLabels: {"4", "5", "6"},
      choiceValues: {1, 2, 3},
      value: ri!tutu
    ),
    a!DropdownField(
      label: "Foo dropdown",
      choiceLabels: {"Test", "Test2"},
      choiceValues: {140, 150},
      value: if(
        and(
          isnull(ri!foo), 
          a!isNotNullOrEmpty(ri!toto), 
          a!isNotNullOrEmpty(ri!tutu)
        ),
        if(
          and(ri!toto = 1, ri!tutu = 2), 
          140, 
          150
        ), 
        ri!foo
      ),
      saveInto: ri!foo
    )
  }

This interface is embedded in a form component, when i submit this form and the default value of the "Foo dropdown" hasn't been changed, since its saveInto aren't triggered, i can't retrieve the values in ri!foo.

I really need this default value system, how can i trigger those saveInto ? 

  Discussion posts and replies are publicly visible

Parents Reply
  • My problem is that by using another component's saveInto to save the default value, let's say i use "Tutu dropdown"'s saveInto for the example, which in my real life case is in another interface, i lose a lot of readability and create unwanted side effect.

    If i later decide to add more elements in my "Foo dropdown"'s saveInto, when setting up my default value, i will have to duplicate the saveInto into another element in another interface to be sure that the default variable and the potential user input follows the same rules.

    In my opinion it would leed to very bad interface design  

Children