#8275 closed defect (fixed)
DTL Template Rendering - Widget Rendering somtimes failed
Reported by: | gchan | Owned by: | Neil Roberts |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | DojoX DTL | Version: | 1.2.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Background Info: Dojo Version: 1.2.3 OS: Ubuntu 8.03 Browser: Firefox 3.0.4 (It also occurs with OS X 10.5 Firefox 3.0.4 as well)
Description: A widget is created using Dojo's DTL templating engine. Sometimes the widget failed to render. (It occurs more frequently if user have an empty cache and load the page for the first time)
For the problem widget, render() is called in postCreate() within the onComplete handler of dojox.data.JsonRestStore?.fetch(). (please see attached code for the problem widget source. (dtlload.js, dtlload.html and data1.js)
According the the Dojo book that is currently online, this should be not be a problem.
"postCreate
This is typically the workhorse of a custom widget. The widget has been rendered (but note that sub-widgets in the containerNode have not!)"
Two firebug screen capture is also attached. Note that in both cases render() was called twice. The case where the render() is successful, first render() call is finished before the second render() call is called. In the case where it failed, the second render() call start before the first one is finished.
Attachments (5)
Change History (15)
Changed 12 years ago by
Changed 12 years ago by
Attachment: | Dojo DTL Render Failed.png added |
---|
Firebug screen capture when rendering failed
Changed 12 years ago by
Attachment: | Dojo DTL Render Success.png added |
---|
Firebug screen capture when rendering is successful
comment:1 follow-up: 2 Changed 12 years ago by
Nite: Custom tracing code was added to dojox.dtl._HtmlTemplated. At the start and end of both buildrender() and render().
comment:2 Changed 12 years ago by
Replying to gchan:
Nite: Custom tracing code was added to dojox.dtl._HtmlTemplated. At the start and end of both buildrender() and render().
Note not Nite.
comment:3 Changed 12 years ago by
Component: | General → Dojox |
---|---|
Owner: | changed from anonymous to Neil Roberts |
comment:4 Changed 12 years ago by
try moving your logic in postCreate to preCreate, and you don't need to call render(), after preCreate() is called, render() will be called for you
comment:5 Changed 12 years ago by
I have moved all the code from postCreate to preCreate. I have an "data_bind didn't receive a store" error.
comment:6 Changed 12 years ago by
Component: | Dojox → DojoX DTL |
---|
comment:7 Changed 12 years ago by
Milestone: | tbd → future |
---|
comment:8 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 Changed 12 years ago by
Code should be moved to postMixInProperties. A default template can be set here as well
comment:10 Changed 12 years ago by
Milestone: | future → 1.3 |
---|
batch move of tickets marked 'future' in the 1.3 timeframe
sample data