This repository was archived by the owner on Jun 3, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
[FormBuilder] Add supports for related fields #7
Copy link
Copy link
Open
Labels
Thoth.Elmish.FormBuilderenhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Issue by MangelMaxime
Thursday Nov 29, 2018 at 12:37 GMT
Originally opened as MangelMaxime/Thoth#94
From @tforkmann on Gitter
I'm just trying out your FormBuilder. Its very cool! Is it possible to use the value of an already selected field for the next form element?
Sure! 1. Field: Select Plant get data from backend 2.field: take selected key from 1. field and get data from the backend using the selected key. That's what i have so far:
let formState, formConfig =
Form<Msg>
.Create(OnFormMsg)
.AddField(
BasicSelect
.Create("selectPlant")
.WithLabel("Anlagenauswahl")
.WithValuesFromServer(getPlants) //Selected Key = PlantId
.WithPlaceholder("")
.IsRequired("Bitte wählen Sie eine Anlage aus!")
.WithDefaultView()
)
.AddField(
BasicSelect
.Create("selectMeter")
.WithLabel("Zählerauswahl")
.WithValuesFromServer(getMeters "4" ) // -> Replace "4" with Selected PlantId in selectPlant Field
.WithPlaceholder("")
.IsRequired("Bitte wählen Sie einen Zähler aus!")
.WithDefaultView()
)
.Build()
Metadata
Metadata
Assignees
Labels
Thoth.Elmish.FormBuilderenhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested