It's all about the answers!

Ask a question

JavaScript and dojo: Widget is "caching" previous WIs and failing to render DataGrid


Kevin Johnson (116) | asked Dec 01 '20, 11:21 p.m.

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 commented Dec 02 '20, 7:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Kevin,

I do not have an answer for you and not the experience. I know that there is at least one complex widget implemented here: https://github.com/jazz-community/rtc-timeboxplanning . Maybe you can look into that and get an idea? https://github.com/jazz-community/ has other projects that might be useful too.

Kevin Johnson commented Dec 02 '20, 11:35 p.m.
Hello Ralph,

Thank you for the references here. I looked for awhile at the rtc-timeboxplanning but found no clues (yet).

-Kevin

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.