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
  • 0
    Certified Lead Developer

    I'm unclear what you're trying to accomplish here.  The apparent value of a dropdown at any given time hinges directly and exclusively on its "value" parameter (or the intersection of the current "value", as well as the choice Label at the same position as the choice Value that matches the current value of the "value" parameter).  This is useful because you can change it externally "from above", for lack of a better term.

    But "triggering the saveinto" is just... not a thing.  It suggests to me that you don't quite firmly understand yet the directionality of how saveIntos work.  I'd suggest boiling it down to a simpler, one-interface example, and getting used to how it works.  This can later be expanded back to a multi-layered interface structure where one calls the other with rule inputs, etc.

Reply
  • 0
    Certified Lead Developer

    I'm unclear what you're trying to accomplish here.  The apparent value of a dropdown at any given time hinges directly and exclusively on its "value" parameter (or the intersection of the current "value", as well as the choice Label at the same position as the choice Value that matches the current value of the "value" parameter).  This is useful because you can change it externally "from above", for lack of a better term.

    But "triggering the saveinto" is just... not a thing.  It suggests to me that you don't quite firmly understand yet the directionality of how saveIntos work.  I'd suggest boiling it down to a simpler, one-interface example, and getting used to how it works.  This can later be expanded back to a multi-layered interface structure where one calls the other with rule inputs, etc.

Children
No Data