[RequiredField] or alternative for ValueInput

Forums 💬 FlowCanvas ⚙️ Support [RequiredField] or alternative for ValueInput

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11994
    tournesol
    Participant

      Hiya !
      We find it very useful to use [RequiredField] on BBParameters to make sure designers are properly warned when they forget something.

      I was wondering if something similar existed for ValueInput ? Because it seems [RequiredField] doesn’t work on ValueInput perhaps I am using it wrong ?

      Is there a bool value I can set in the RegisterPort method perhaps that would force the designer to either link the input to another ValueOutput or field the value by hand ?
      myValueInput.required = true;

      I know it would work only on nullable types but this would go a long way.
      Also I am running a 2 years old flowcanvas so perhaps that feature has been implemented later on ?
      Thanks.

      #11997
      Gavalakis
      Keymaster

        Hello,

        The [RequiredField] does indeed not work with ValueInputs. To be honest, I haven’t thought of adding something similar for ValuePorts. Is the goal to show some UI error for example? I could make the [RequiredField] work on ValuePorts (and/or a way to set a ValuePort to be required in the RegisterPorts method).

        Let me know.

        Thanks!

        #11996
        tournesol
        Participant

          Something like that that would seem perfect thanks ^^

          Just making it work in the same way the BBParam works would go a long way, especially for designers.

          In the example below because the ValueInput is not fielded nor connected I would expect it to be red like the BBParam is.
          [attachment file=”ParameterValidation.jpg”]

          The red would disappear when the connection happens or if the field has a value:

          [attachment file=”ParameterValidation2.jpg”]

          Also it seems important that if a Required field is not set in the node then the node should also show up a red sign, similar to what behaviour trees are doing:

          [attachment file=”ParameterValidation3.jpg”]

          #11995
          tournesol
          Participant

            I could make the [RequiredField] work on ValuePorts (and/or a way to set a ValuePort to be required in the RegisterPorts method).

            I am not sure which one would be best, perhaps both? I know that having [RequiredField] work across the board is more intuitive 😀
            Perhaps the second solution is only useful if the first is not possible ?

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.