PCF Code Component Life Cycle

When we develop code component, we implement StandardControl interface and its methods. These methods helps hosting runtime to manage life cycle of code component.

Below are the methods that needs to be used when creating a code component:

  • init
    • Required
    • Initializes code component instance
    • Kicks off remote server calls
    • Initializes actions
    • Cannot initialize Dataset values
  • updateView
    • Required
    • Initialize Dataset values
    • Will be called when any component’s property value has changed
  • getOutputs
    • Optional
    • Used when bound properties are dynamically managed by control
    • This method is called by framework before receiving new data
  • destroy
    • Required
    • This is invoked when code component needs to be removed from DOM tree and is no longer in use by the current process.
    • Used for cleanup
    • Releases any used memory
Image Source: Microsoft Learn

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s