Hello,
I have a Forge app, using a Custom Field Type module (with UI Kit version 2), I am using a Form and adding a Dynamic Table. The dynamic table has some Selects. This works fine, as they are shown as well as their values. I am using the useForm() state and some of its functions to get the values from the form. in the content element of the row, I added a Label using the getFieldId function. However, if I add the {…register} sentence to the selects, and select a value, the value in the selects returns to null immediately. If I eliminate the {…register} it works fine again. This is more or less how the row containing a select looks:
{
key: "row1key",
content: (
<Label labelFor={getFieldId("myFieldId")}/>
<Select {...register("myFieldId")}
name="test"
options={arrayOfOptions}
/>
)
},
Do you know if it is possible to use functions of the useForm react hook in rows of Dynamic Tables? I need to get the selected values to save them on a configuration page. Or is there another way to get the selected values from the Selects of the rows in the dynamic table?
Thanks