Closed jatindhawan closed 8 years ago
@nicklockwood Do you know what I'm trying to ask, need more details?
The FieldSelectorViewController should have a field property of type FXFormField, like this:
@property (nonatomic, strong) FXFormField *field;
This will be automatically populated by the parent form (your DynamicForm class) when the Reason field is selected.
To update the value from within the FieldSelectorViewController, just set the value of the field, like this:
self.field.value = @"New Value";
And that should then update the value of the Reason property in the DynamicForm. To refresh the display of the field in the FieldSelectorViewController you may also need to call
[self.tableView reloadData];
Yes thats what I am doing, don't know why isnt it working
Sent from my iPhone
On Dec 2, 2015, at 9:21 PM, Nick Lockwood notifications@github.com<mailto:notifications@github.com> wrote:
The FieldSelectorViewController should have a field property of type FXFormField, like this:
@property (nonatomic, strong) FXFormField *field;
This will be automatically populated by the parent form (your DynamicForm class) when the Reason field is selected.
To update the value from within the FieldSelectorViewController, just set the value of the field, like this:
self.field.value = @"New Value";
And that should then update the value of the Reason property in the DynamicForm. To refresh the display of the field in the FieldSelectorViewController you may also need to call
[self.tableView reloadData];
Reply to this email directly or view it on GitHubhttps://github.com/nicklockwood/FXForms/issues/431#issuecomment-161496123.
I think I'm going to have to see more of the code to debug this.
found the problem, I was supplying options through property FXFormFieldOptions: @[ @"test"] and that coupled with FXFormFieldViewController: @"FieldSelectorViewController"
presence of both of these was preventing the update of value as I guess it must have been looking for a value from one of the options.
I have a CreateFormViewController, init looks like below:
I am first using a json file to define all fields. Consider this example of a field which has following properties:
Now in the Dynamicform I have assigned a customised FXFormFieldViewController to Reason field:
Now in FieldSelectorViewController, I get data from server and display all options and then upon selection of a field I tried a few things to update the field value in the form from previous controller:
but it is not working