public/javascripts/yui/element/element.js
function(value, silent) {
        var beforeRetVal,
            owner = this.owner,
            name = this.name;
        
        var event = {
            type: name, 
            prevValue: this.getValue(),
            newValue: value
        };
        
        if (this.readOnly || ( this.writeOnce && this._written) ) {
            return false; // write not allowed
        }
        
        if (this.validator && !this.validator.call(owner, value) ) {
            return false; // invalid value
        }

        if (!silent) {
            beforeRetVal = owner.fireBeforeChangeEvent(event);
            if (beforeRetVal === false) {
                return false;
            }
        }

        if (this.setter) {
            value = this.setter.call(owner, value, this.name);
            if (value === undefined) {
            }
        }
        
        if (this.method) {
            this.method.call(owner, value, this.name);
        }
        
        this.value = value; // TODO: set before calling setter/method?
        this._written = true;
        
        event.type = name;
        
        if (!silent) {
            this.owner.fireChangeEvent(event);
        }
        
        return true;
    }
function(value, silent) {
        var beforeRetVal,
            owner = this.owner,
            name = this.name;
        
        var event = {
            type: name, 
            prevValue: this.getValue(),
            newValue: value
        };
        
        if (this.readOnly || ( this.writeOnce && this._written) ) {
            return false; // write not allowed
        }
        
        if (this.validator && !this.validator.call(owner, value) ) {
            return false; // invalid value
        }

        if (!silent) {
            beforeRetVal = owner.fireBeforeChangeEvent(event);
            if (beforeRetVal === false) {
                return false;
            }
        }

        if (this.setter) {
            value = this.setter.call(owner, value, this.name);
            if (value === undefined) {
            }
        }
        
        if (this.method) {
            this.method.call(owner, value, this.name);
        }
        
        this.value = value; // TODO: set before calling setter/method?
        this._written = true;
        
        event.type = name;
        
        if (!silent) {
            this.owner.fireChangeEvent(event);
        }
        
        return true;
    }
function ( value , silent ) { var beforeRetVal , owner = this . owner , name = this . name ; var event = { type : name , prevValue : this . getValue ( ) , newValue : value } ; if ( this . readOnly || ( this . writeOnce && this . _written ) ) { return false ; // write not allowed } if ( this . validator && ! this . validator . call ( owner , value ) ) { return false ; // invalid value } if ( ! silent ) { beforeRetVal = owner . fireBeforeChangeEvent ( event ) ; if ( beforeRetVal === false ) { return false ; } } if ( this . setter ) { value = this . setter . call ( owner , value , this . name ) ; if ( value === undefined ) { } } if ( this . method ) { this . method . call ( owner , value , this . name ) ; } this . value = value ; // TODO: set before calling setter/method? this . _written = true ; event . type = name ; if ( ! silent ) { this . owner . fireChangeEvent ( event ) ; } return true ; }
Sets the value of the attribute and fires beforeChange and change events.
@method setValue
@param {Any} value The value to apply to the attribute.
@param {Boolean} silent If true the change events will not be fired.
@return {Boolean} Whether or not the value was set.
Sets the value of the attribute and fires beforeChange and change events .