this.value in postCreate returns null after upgrade

  • Updated

This article describes an issue that appears after upgrading to Episerver 10 from Episerver 9. According to the documentation here the value of the property would be available in the postCreate method. The console.logs to all of the lifecycle methods(postCreate, buildRendering, startup...) and this.value is null in all of them. _setValueAttr is called AFTER the startup method.

So the steps would be:

  • Create a new Dojo widget
  • Save a value
  • Console.log in postCreate

Expected behavior: value is not null or undefined
Actual behavior: value is null/undefined.

This issue was discussed in CMS-8197. This is not a product defect, but a design change which was not clear in the documentation. The documentation has been updated here.

Please follow the steps in this updated document to avoid this issue.