summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/js/compressed/prado.js6
-rw-r--r--framework/Web/Javascripts/js/debug/prado.js3
-rw-r--r--framework/Web/Javascripts/prado/element.js3
3 files changed, 9 insertions, 3 deletions
diff --git a/framework/Web/Javascripts/js/compressed/prado.js b/framework/Web/Javascripts/js/compressed/prado.js
index a1da1efb..e1c566e0 100644
--- a/framework/Web/Javascripts/js/compressed/prado.js
+++ b/framework/Web/Javascripts/js/compressed/prado.js
@@ -259,11 +259,11 @@ $('PRADO_POSTBACK_TARGET').value=options['EventTarget'];$('PRADO_POSTBACK_PARAME
Prado.Element={setValue:function(element,value)
{var el=$(element);if(el&&typeof(el.value)!="undefined")
el.value=value;},select:function(element,method,value,total)
-{var el=$(element);var selection=Prado.Element.Selection;if(typeof(selection[method])=="function")
+{var el=$(element);if(!el)return;var selection=Prado.Element.Selection;if(typeof(selection[method])=="function")
{control=selection.isSelectable(el)?[el]:selection.getListElements(element,total);selection[method](control,value);}},click:function(element)
{var el=$(element);if(el)
Event.fireEvent(el,'click');},setAttribute:function(element,attribute,value)
-{var el=$(element);if((attribute=="disabled"||attribute=="multiple")&&value==false)
+{var el=$(element);if(!el)return;if((attribute=="disabled"||attribute=="multiple")&&value==false)
el.removeAttribute(attribute);else if(attribute.match(/^on/i))
{try
{eval("(func = function(event){"+value+"})");el[attribute]=func;}
@@ -271,7 +271,7 @@ catch(e)
{throw"Error in evaluating '"+value+"' for attribute "+attribute+" for element "+element.id;}}
else
el.setAttribute(attribute,value);},setOptions:function(element,options)
-{var el=$(element);if(el&&el.tagName.toLowerCase()=="select")
+{var el=$(element);if(!el)return;if(el&&el.tagName.toLowerCase()=="select")
{el.options.length=options.length;for(var i=0;i<options.length;i++)
el.options[i]=new Option(options[i][0],options[i][1]);}},focus:function(element)
{var obj=$(element);if(typeof(obj)!="undefined"&&typeof(obj.focus)!="undefined")
diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js
index 9a6cc823..a1a224b9 100644
--- a/framework/Web/Javascripts/js/debug/prado.js
+++ b/framework/Web/Javascripts/js/debug/prado.js
@@ -2943,6 +2943,7 @@ Prado.Element =
select : function(element, method, value, total)
{
var el = $(element);
+ if(!el) return;
var selection = Prado.Element.Selection;
if(typeof(selection[method]) == "function")
{
@@ -2961,6 +2962,7 @@ Prado.Element =
setAttribute : function(element, attribute, value)
{
var el = $(element);
+ if(!el) return;
if((attribute == "disabled" || attribute == "multiple") && value==false)
el.removeAttribute(attribute);
else if(attribute.match(/^on/i)) //event methods
@@ -2982,6 +2984,7 @@ Prado.Element =
setOptions : function(element, options)
{
var el = $(element);
+ if(!el) return;
if(el && el.tagName.toLowerCase() == "select")
{
el.options.length = options.length;
diff --git a/framework/Web/Javascripts/prado/element.js b/framework/Web/Javascripts/prado/element.js
index 0d08a200..b21782fe 100644
--- a/framework/Web/Javascripts/prado/element.js
+++ b/framework/Web/Javascripts/prado/element.js
@@ -15,6 +15,7 @@ Prado.Element =
select : function(element, method, value, total)
{
var el = $(element);
+ if(!el) return;
var selection = Prado.Element.Selection;
if(typeof(selection[method]) == "function")
{
@@ -33,6 +34,7 @@ Prado.Element =
setAttribute : function(element, attribute, value)
{
var el = $(element);
+ if(!el) return;
if((attribute == "disabled" || attribute == "multiple") && value==false)
el.removeAttribute(attribute);
else if(attribute.match(/^on/i)) //event methods
@@ -54,6 +56,7 @@ Prado.Element =
setOptions : function(element, options)
{
var el = $(element);
+ if(!el) return;
if(el && el.tagName.toLowerCase() == "select")
{
el.options.length = options.length;