View Full Version : UpdateManager

15 Nov 2006, 6:20 AM
In Update Method,

When i create object passing a elementID which does not exists, in the Update function it access the dom.innerHTML without cheking if the dom is null or not :)

I hope this explaination is clear, if not try creating UpdateManager object passing in elementID which does'nt exists in your page.

15 Nov 2006, 6:24 AM
That's a bug in your bug, not mine. :)

Silently swallowing errors is not something I do - it makes REAL problems impossible to track. Make sense?

15 Nov 2006, 6:38 AM
Following flags the error this.dom is null in the yui-ext-core file at line number 115, in the update function. Can you tell why this is happening

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<title>Loading Indicaator Example</title>
<style type="text/css">
.loading-indicator {
background-image: url('images/wait.gif');
background-repeat: no-repeat;
background-position: left;
#example {
border-right: black 1px solid;
border-top: black 1px solid;
border-left: black 1px solid;
border-bottom: black 1px solid;
background-color: #ffccff;

<script type="text/javascript" src="js/yui0114/yahoo-min.js"></script>
<script type="text/javascript" src="js/yui0114/dom-min.js"></script>
<script type="text/javascript" src="js/yui0114/event-min.js"></script>
<script type="text/javascript" src="js/yui0114/dragdrop-min.js"></script>
<script type="text/javascript" src="js/yui0114/animation-min.js"></script>
<script type="text/javascript" src="js/yui0114/connection-min.js"></script>

<script type="text/javascript" src="js/jsb3231/yui-ext-core.js"></script>

<script type="text/javascript">
var ajaxExample = {
ajaxInit : function(){
var mgr = new YAHOO.ext.UpdateManager('example1');//pass the element id here

mgr.onUpdate.subscribe(this.onCallSuccess);//callback for success
mgr.onFailure.subscribe(this.onCallFailure);//callback for failure
mgr.update('LoadingHandler.ashx');//server script to call

onCallSuccess : function(oElement,oResponse){
//example.innerHTML = oResponse.responseText;

onCallFailure: function(oElement,oResponse){
alert("failure - example div");
YAHOO.ext.EventManager.onDocumentReady(ajaxExample.ajaxInit, ajaxExample, true);

<div id="example"> </div>

15 Nov 2006, 6:46 AM
Your div is called example, yet you are trying to render the grid to example1

15 Nov 2006, 6:54 AM
Actually that was intentional to put "1" there just to show that the id (example1) does'nt exists and in such case we have error flagged. I thought it would be better to have a check so that this error doesnt cum up as runtime error, though we can obiviously check first that elementID exists or not before actually creating the object of UpdateManager..