Problem statement
Setting the field value before the source block has been provided causes a few problems:
- Class validators are not allowed to access the source block or workspace.
- Local validators don't run on the field's constructed value.
- initModel exists when its functionality could (and should) be handled by doValueUpdate_.
Proposed solution
I think all of the above could be solved in a backwards compatible way simply by caching the field's constructed value, and not setting it until the source block has been provided.
- Class validators could then be assured that the source block and workspace exist.
- Local validators would be able to run on the constructed value and still access the sourceblock and workspace without worry.
- initModel functionality could be easily moved to doValueUpdate_, simplifying the field lifecycle.
Additional Information
N/A
Problem statement
Setting the field value before the source block has been provided causes a few problems:
Proposed solution
I think all of the above could be solved in a backwards compatible way simply by caching the field's constructed value, and not setting it until the source block has been provided.
Additional Information
N/A