Interface FormFieldScope

  • All Implemented Interfaces:

    
    public interface FormFieldScope<V extends Object>
    
                        

    A scope interface for FormField objects

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit setField(V input, Boolean validate) A setter function for field valueYou're encouraged to set the field value only using this function
      abstract Unit setFieldResult(Result<V> input) A setter function for field value or error.
      abstract State<V> getState() Observable State instance of field value
      abstract State<FieldResult> getResultState() Observable State instance of FieldResultYou can use this for validation results
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • setField

         abstract Unit setField(V input, Boolean validate)

        A setter function for field value

        You're encouraged to set the field value only using this function

        Parameters:
        input - Field value
        validate - Validate the input on update
      • setFieldResult

         abstract Unit setFieldResult(Result<V> input)

        A setter function for field value or error.

        Set the field value if the input is successful, fail validation if the input is an error.

        To be used for custom fields with built-in validation.

        Parameters:
        input - Field value or error
      • getResultState

        @Composable() abstract State<FieldResult> getResultState()

        Observable State instance of FieldResult

        You can use this for validation results