-
-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Description
Im using Nylo Forms and trying to initialise data in form class, referring docs-https://nylo.dev/docs/6.x/forms#managing-form-data
However I have noticed that picker fields which uses List are not getting initialised from init method. If I use form.setFieldOptions it is getting initialised. Am I doing something wrong or docs are not updated or this is bug.
@override
get init => () async {
/// Initial data for the form
unitData = await api<CommonApiService>((request) => request.fetchDropDowns(nType: 'DDL_BookingUnit'));
return {
'unit': unitData.map((e) => e.ddlDesc ?? "").toList()
// 'unit': ['Unit1','Unit2'] // this also doesnt work
};
};
@override
fields() {
return [
Field.picker("unit",
options: [],
label: "Unit",
validate: FormValidator.notEmpty())
....
Metadata
Metadata
Assignees
Labels
No labels