How to handle a nullable object in the form.
I have an object that is nullable but if I try to access it using
<form.Field name="item.nullable_object"></form.Field>
and it's null, an error is thrown.
Think as the structure like this:
2 Replies
stormy-gold•17mo ago
What would be a usecase for
null
in a form?foreign-sapphireOP•16mo ago
Sorry for the delay.
Been going through a lot in the past few days.
The use case mostly is that we have big forms that are have some related data from other models attached to them.
We have a few one to one relations ships that we show in a single form.
Some of the are optional.
Something like this:
So the manufacurer for the item is optional.
This is really killing the usage for me...
We have a lot of related models which we show in the forms, and they can be null.
Can't represent that right now without excessive workarounds and manual handling of things.