Interface FormFieldScope
-
- All Implemented Interfaces:
public interface FormFieldScope<V extends Object>A scope interface for FormField objects
-
-
Method Summary
Modifier and Type Method Description abstract UnitsetField(V input, Boolean validate)A setter function for field valueYou're encouraged to set the field value only using this function abstract UnitsetFieldResult(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 -
-
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 valuevalidate- 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
-
getState
@Composable() abstract State<V> getState()
Observable State instance of field value
-
getResultState
@Composable() abstract State<FieldResult> getResultState()
Observable State instance of FieldResult
You can use this for validation results
-
-
-
-