Lines Matching refs:name
5 * but can also be used independently to provide a name/property/value data structure to
144 * <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>
168 * <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>
179 * <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>
189 * <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>
199 * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with
207 * @param {String} name The name of the attribute.
221 addAttr: function(name, config, lazy) {
223 Y.log('Adding attribute: ' + name, 'info', 'attribute');
234 if (lazy && !host.attrAdded(name)) {
235 state.addAll(name, {
241 if (host.attrAdded(name) && !state.get(name, IS_LAZY_ADD)) { Y.log('Attribute: ' + name + ' already exists. Cannot add it again without removing it first', 'warn', 'attribute'); }
243 if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {
247 if (config.readOnly && !hasValue) { Y.log('readOnly attribute: ' + name + ', added without an initial value. Value will be set on initial call to set', 'warn', 'attribute');}
258 state.addAll(name, config);
262 host.set(name, value);
265 state.remove(name, INITIALIZING);
276 * @param {String} name The name of the attribute to check.
277 * @return {boolean} true if an attribute with the given name has been added, false if it hasn't. This method will return true for lazily added attributes.
279 attrAdded: function(name) {
280 return !!this._state.get(name, ADDED);
290 * @param {String} name The name of the attribute. If the value of the attribute is an Object,
295 get : function(name) {
296 return this._getAttr(name);
305 * @param {String} name The name of the attribute
308 _isLazyAttr: function(name) {
309 return this._state.get(name, LAZY);
317 * @param {Object} name The name of the attribute
319 _addLazyAttr: function(name, cfg) {
321 lazyCfg = state.get(name, LAZY);
323 state.add(name, IS_LAZY_ADD, true);
324 state.remove(name, LAZY);
325 this.addAttr(name, lazyCfg);
334 * @param {String} name The name of the attribute. If the
342 set : function(name, val) {
343 return this._setAttr(name, val);
353 * @param {String} name The name of the attribute.
357 _set : function(name, val) {
358 return this._setAttr(name, val, null, true);
370 * @param {String} name The name of the attribute.
382 _setAttr : function(name, val, opts, force) {
399 if (name.indexOf(DOT) !== -1) {
400 strPath = name;
401 path = name.split(DOT);
402 name = path.shift();
405 if (this._isLazyAttr(name)) {
406 this._addLazyAttr(name);
409 cfg = state.getAll(name, true) || {};
413 if (stateProxy && name in stateProxy && !cfg._bypassProxy) {
424 Y.log('Set attribute:' + name + ', aborted; Attribute is writeOnce', 'warn', 'attribute');
429 Y.log('Set attribute:' + name + ', aborted; Attribute is readOnly', 'warn', 'attribute');
435 Y.log('Set attribute:' + name + ', aborted; Attribute is writeOnce: "initOnly"', 'warn', 'attribute');
442 currVal = this.get(name);
456 this._setAttrVal(name, strPath, currVal, val);
460 this._fireAttrChange(name, strPath, currVal, val, opts);
478 * @param {String} name The name of the attribute.
481 _getAttr : function(name) {
483 fullName = name,
490 if (name.indexOf(DOT) !== -1) {
491 path = name.split(DOT);
492 name = path.shift();
496 if (host._tCfgs && host._tCfgs[name]) {
498 cfg[name] = host._tCfgs[name];
499 delete host._tCfgs[name];
504 if (host._isLazyAttr(name)) {
505 host._addLazyAttr(name);
508 val = host._getStateVal(name);
510 getter = state.get(name, GETTER);
528 * @param {String} name The name of the attribute
531 _getStateVal : function(name) {
533 return stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY) ? stateProxy[name] : this._state.get(name, VALUE);
542 * @param {String} name The name of the attribute
545 _setStateVal : function(name, value) {
547 if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {
548 stateProxy[name] = value;
550 this._state.add(name, VALUE, value);
560 * @param {String} attrName The attribute name.
561 * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property ("x.y.z").
576 name = subAttrName || attrName,
586 valid = validator.call(host, newVal, name);
602 retVal = setter.call(host, newVal, name);
639 * @param {Object} attrs An object with attributes name/value pairs.
652 * @param {Object} attrs An object with attributes name/value pairs.
671 * @return {Object} An object with attribute name/value pairs.
684 * @return {Object} An object with attribute name/value pairs.
719 * @param {Object} cfgs An object with attribute name/configuration pairs.
720 * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
750 * @param {Object} cfgs An object with attribute name/configuration pairs.
751 * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
813 * @param {Object} valueHash An object with attribute name/value pairs
829 * @param {String} attr The name of the attribute
831 * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals