Jul 22, 2010, 6:48 PM
[CLOSED] Image complete event always fire when resetting src
Html Image.complete property is readonly. After initial load is done, the property will remain true even when you reset the Image's src. The Ext.net.Image's checkTask checks this complete property to test if image is finished loading. After the initial load, the checkTask will always think the image has been loaded even if the new image src takes a while to load.
Here's my scenario. I have an image with src initially set to a cached version of a graph. That returns immediately. A button on the form can be used to refresh the image/graph. At that point, I change image path to a httphandler that hits the database for data and outputs a graph. That process can take a few seconds so I throw up a mask in the new beforeload event. In the complete event, I remove the mask. Since the Image.complete property is already true from the initial cached image, the mask goes away very fast but the report is still loading.
The only fix to this I think is to put a new AutoDestroyImage (or something) property on Ext.net.Image. When setImageUrl is called, it will destroy existing imageProxy and create a new one.
Here's my scenario. I have an image with src initially set to a cached version of a graph. That returns immediately. A button on the form can be used to refresh the image/graph. At that point, I change image path to a httphandler that hits the database for data and outputs a graph. That process can take a few seconds so I throw up a mask in the new beforeload event. In the complete event, I remove the mask. Since the Image.complete property is already true from the initial cached image, the mask goes away very fast but the report is still loading.
The only fix to this I think is to put a new AutoDestroyImage (or something) property on Ext.net.Image. When setImageUrl is called, it will destroy existing imageProxy and create a new one.
Last edited by geoffrey.mcgill; Jul 28, 2010 at 8:34 PM.