JavaScript and dojo: Widget is "caching" previous WIs and failing to render DataGrid
Hello,
We posted a question yesterday and we have made some progress and have narrowed it down a bit - so we are now asking a more precise question.
Our post yesterday - which gives some more background:
https://jazz.net/forum/questions/272454/how-to-use-dojoready-or-dojodomready-with-ewm-custom-presentation
Today, here is where we are:
Using JavaScript and dojo, we've written a non-trivial custom EWM presentation for a customer which extends dijit._Widget and dijit._Templated and uses dojox.grid.DataGrid.
The DataGrid renders well - most of the time. The DataGrid does NOT render on the EWM work item if we have visited that work item earlier in the web browser session. It is as if something is cached somewhere and that caching is interfering with our code.
For example, after starting up a fresh browser and logging in, if we navigate to WI 1000 then the DataGrid displays properly. Then if we visit WI 2000, all good. Visit 3000, all good. But if we go back to WI 1000 or 2000 then the DataGrid does not render. If we click the yellow double-arrow refresh button then the DataGrid renders properly. It looks like placeAt() fails because parentNode == null - but we do not know what parentNode it is referring to.
Also, in addition to the DataGrid not rendering we see that this.workingCopy.idLabel equals 3000 for example when we go visit an earlier WI such as 2000.
What are we missing? What do we need to do before placeAt()? How do we refresh this.workingCopy to properly reflect the WI we are viewing and to allow the DataGrid to render.
One more observation. As we navigate to different WIs we see that our codes constructor() and postCreate() functions are being called. But if we visit a WI that we have previously visited then the constructor() and postCreate() functions are not being called. The instance is being re-used for the "cached" WI.
Thank you for any and all help or clues.
Regards,
Kevin
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 02 '20, 7:03 a.m.Kevin Johnson
Dec 02 '20, 11:35 p.m.