Fix Javascript errors on the ErrorPage template preventing the display of 'friendly errors'.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3789 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
hardya
2008-02-29 16:22:28 +00:00
parent 5b07e0ce5c
commit 5e71be13b1

View File

@@ -187,9 +187,9 @@ c1:=c1||'://www.nationalgrid.com/"><img src="/i/ng_logo_group_medium.gif" alt="N
'</div>'||chr(10)||
'<div id="navHousekeep" class="hskpcol2">'||chr(10)||
'<div class="margin5">'||chr(10)||
'<a href="this is the url for the holding page for the ICOMQ system" class="hskpnav" title="Return to the Metering Online Quotations Home Page" accesskey="1">Home</a>&nbsp;|&nbsp;<a href="&LOGOUT_URL." c';
'<a href="holdingpagefortheICOQsystem" class="hskpnav" title="Return to the Metering Online Quotations Home Page" accesskey="1">Home</a>&nbsp;|&nbsp;<a href="&LOGOUT_URL." class="hskpnav" title="Log out ';
c1:=c1||'lass="hskpnav" title="Log out of the system" accesskey="2">Logout</a>&nbsp;|&nbsp;<!--a href="/group/help" class="hskpnav">Help</a>&nbsp;|&nbsp;--><span>You are logged in as:&APP_USER.</span>'||chr(10)||
c1:=c1||'of the system" accesskey="2">Logout</a>&nbsp;|&nbsp;<!--a href="/group/help" class="hskpnav">Help</a>&nbsp;|&nbsp;--><span>You are logged in as:&APP_USER.</span>'||chr(10)||
'</div>'||chr(10)||
'</div>'||chr(10)||
'</div>'||chr(10)||
@@ -982,9 +982,9 @@ c1:=c1||'l1">'||chr(10)||
'</div>'||chr(10)||
'<div id="navHousekeep" class="hskpcol2">'||chr(10)||
'<div class="margin5">'||chr(10)||
'<a href="this is the url for the holding page for the ICOMQ system" class="hskpnav" title="Return to the Metering Online Quotations Home Page" accesskey="1">Home</a>&nbsp;|&nbsp;<a href="&LOGOUT_URL." class=';
'<a href="holdingpagefortheICOQsystem" class="hskpnav" title="Return to the Metering Online Quotations Home Page" accesskey="1">Home</a>&nbsp;|&nbsp;<a href="&LOGOUT_URL." class="hskpnav" title="Log out of th';
c1:=c1||'"hskpnav" title="Log out of the system" accesskey="2">Logout</a>&nbsp;|&nbsp;<!--a href="/group/help" class="hskpnav">Help</a>&nbsp;|&nbsp;--><span>You are logged in as:&APP_USER.</span>'||chr(10)||
c1:=c1||'e system" accesskey="2">Logout</a>&nbsp;|&nbsp;<!--a href="/group/help" class="hskpnav">Help</a>&nbsp;|&nbsp;--><span>You are logged in as:&APP_USER.</span>'||chr(10)||
'</div>'||chr(10)||
'</div>'||chr(10)||
'</div>'||chr(10)||
@@ -997,10 +997,10 @@ c1:=c1||'"hskpnav" title="Log out of the system" accesskey="2">Logout</a>&nbsp;|
'function MyErrorPage(p_err_item,p_err_process)'||chr(10)||
'{'||chr(10)||
''||chr(10)||
' va';
' var vElementList = null;'||chr(10)||
' var v';
c1:=c1||'r vElementList = null;'||chr(10)||
' var vElement = null;'||chr(10)||
c1:=c1||'Element = null;'||chr(10)||
' var vErrorStack = null;'||chr(10)||
' var vOraErrorStack = null;'||chr(10)||
' var vOraError = null;'||chr(10)||
@@ -1016,9 +1016,9 @@ c1:=c1||'r vElementList = null;'||chr(10)||
' return;'||chr(10)||
''||chr(10)||
' vElementList = window.document.getElementsByTagName("div");'||chr(10)||
' for (i=0; ';
' for (i=0; i < vElementList.length; i++)';
c1:=c1||'i < vElementList.length; i++)'||chr(10)||
c1:=c1||''||chr(10)||
' {'||chr(10)||
' vElement = vElementList[i];'||chr(10)||
' '||chr(10)||
@@ -1027,33 +1027,35 @@ c1:=c1||'i < vElementList.length; i++)'||chr(10)||
' vErrorStack = (vErrorStack ==null?"":vErrorStack)+vElement.innerHTML;'||chr(10)||
' vElement.innerHTML = '''';'||chr(10)||
' vOraErrorStack = vErrorStack.split("ORA-");'||chr(10)||
' for(var j=1; j < vOraErrorStack.length; j++) {'||chr(10)||
' vOraError = vOraErrorStack[j];'||chr(10)||
' vAjaxRequest = new htmldb_G';
' if (vOraErrorStack.length > 0) {'||chr(10)||
' for(var j=1; j < vOraErrorStack.length; j++) {'||chr(10)||
' vOraError = vOraErrorStack[j];'||chr(10)||
' vAjaxRequest ';
c1:=c1||'et(null,&APP_ID.,''APPLICATION_PROCESS=''+p_err_process,0);'||chr(10)||
' vAjaxRequest.add(p_err_item,vOraError);'||chr(10)||
' vAjaxResult = vAjaxRequest.get();'||chr(10)||
' if (vAjaxResult) {'||chr(10)||
' vMyMsg = vMyMsg + vAjaxResult;'||chr(10)||
' } else {'||chr(10)||
' vMyMsg = vMyMsg + vOraError.substring(0);'||chr(10)||
c1:=c1||'= new htmldb_Get(null,&APP_ID.,''APPLICATION_PROCESS=''+p_err_process,0);'||chr(10)||
' vAjaxRequest.add(p_err_item,vOraError);'||chr(10)||
' vAjaxResult = vAjaxRequest.get();'||chr(10)||
' if (vAjaxResult) {'||chr(10)||
' vMyMsg = vMyMsg + vAjaxResult;'||chr(10)||
' } else {'||chr(10)||
' vMyMsg = vMyMsg + vOraError.substring(0);'||chr(10)||
' }'||chr(10)||
' }'||chr(10)||
' }'||chr(10)||
'if (document.getElementById && document.createElement) {'||chr(10)||
' var divA = document.getElementById(''ErrorOu';
'if (document.getElementById && document.createElement && vMyMsg.len';
c1:=c1||'tputDiv'');'||chr(10)||
c1:=c1||'gth > 0) {'||chr(10)||
' var divA = document.getElementById(''ErrorOutputDiv'');'||chr(10)||
' var oH = document.createElement(''h1'');'||chr(10)||
' oH.appendChild(document.createTextNode(''Validation failed because:''));'||chr(10)||
' var oP = document.createElement(''p'');'||chr(10)||
' oP.id = ''FriendlyError'';'||chr(10)||
' oP.appendChild(document.createTextNode(vMyMsg));'||chr(10)||
' // Insert the heading as the first child of the element'||chr(10)||
' divA.insertBefore(oP, divA.firstChild);'||chr(10)||
' divA.insertBefore(oH, divA.firstChild);';
' divA.insertBefore(oP, div';
c1:=c1||''||chr(10)||
c1:=c1||'A.firstChild);'||chr(10)||
' divA.insertBefore(oH, divA.firstChild);'||chr(10)||
' }'||chr(10)||
' }'||chr(10)||
' }'||chr(10)||
@@ -1082,6 +1084,7 @@ c2:=c2||'<div id="rowFooter"><!-- bottom strip of info -->'||chr(10)||
c2:=c2||' <a href="thetermsandconditions.htm">Terms &amp; conditions</a>'||chr(10)||
''||chr(10)||
' | <a href="theprivacypolicy.htm">Privacy policy</a>'||chr(10)||
' | <span style="color:#0067c6; text-decoration:none" id="app_version">#APP_VERSION#</span>'||chr(10)||
' </div>'||chr(10)||
' </div>'||chr(10)||
' '||chr(10)||