Skip to content

Proposal: Wait to Set Field Value Until SourceBlock is Set #2586

Description

@BeksOmega

Problem statement

Setting the field value before the source block has been provided causes a few problems:

  1. Class validators are not allowed to access the source block or workspace.
  2. Local validators don't run on the field's constructed value.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions