Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bindable disabled attribute in input-based and select html widgets #618

Closed
wants to merge 1 commit into from

1 participant

@flongo
Collaborator

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.

@flongo flongo referenced this pull request from a commit in flongo/ariatemplates
@flongo flongo feat #618 Bindable disabled attribute in input-based and select html …
…widgets

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
5cda1d7
@flongo flongo referenced this pull request from a commit in flongo/ariatemplates
@flongo flongo feat #618 Bindable disabled attribute in input-based and select html …
…widgets

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
0d04772
@flongo flongo referenced this pull request from a commit in flongo/ariatemplates
@flongo flongo feat #618 Bindable disabled attribute in input-based and select html …
…widgets

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
8b1b3a0
@flongo flongo referenced this pull request from a commit in flongo/ariatemplates
@flongo flongo feat #618 Bindable disabled attribute in input-based and select html …
…widgets

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
26c78f8
@flongo flongo referenced this pull request from a commit in flongo/ariatemplates
@flongo flongo feat #618 Bindable disabled attribute in input-based and select html …
…widgets

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
97afb9a
@flongo flongo referenced this pull request from a commit in flongo/ariatemplates
@flongo flongo feat #618 Bindable disabled attribute in input-based and select html …
…widgets

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
ff1ab8a
@flongo flongo feat #618 Bindable disabled attribute in input-based and select html …
…widgets

This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
97b22b4
@flongo flongo referenced this pull request from a commit
@flongo flongo feat #618 Bindable disabled attribute
This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.

Close #618
622c008
@flongo flongo closed this pull request from a commit
@flongo flongo feat #618 Bindable disabled attribute
This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.

Close #618
622c008
@flongo flongo closed this in 622c008
@flongo flongo deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 17, 2013
  1. @flongo

    feat #618 Bindable disabled attribute in input-based and select html …

    flongo authored
    …widgets
    
    This commit introduces the possibility to bind the disabled attribute of all input-based html widgets as well as the select html widget.
This page is out of date. Refresh to see the latest.
View
3  src/aria/html/CheckBox.js
@@ -58,7 +58,7 @@
* Initialization method called after the markup of the widget has been inserted in the DOM.
*/
initWidget : function () {
- this.$Element.initWidget.call(this);
+ this.$InputElement.initWidget.call(this);
var bindings = this._cfg.bind;
if (bindings.checked) {
@@ -78,6 +78,7 @@
* @param {Object} oldValue Value of the property before the change happened
*/
onbind : function (name, value, oldValue) {
+ this.$InputElement.onbind.apply(this, arguments);
if (name === "checked") {
this._domElt.checked = value;
}
View
55 src/aria/html/DisabledTrait.js
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Common class for all elements supporting a disabled attribute
+ */
+Aria.classDefinition({
+ $classpath : "aria.html.DisabledTrait",
+ $dependencies : ["aria.utils.Type", "aria.utils.Json"],
+ $prototype : {
+
+ /**
+ * Initialize the disabled attribute of the widget by taking into account the data model to which it might be
+ * bound.
+ */
+ initDisabledWidgetAttribute : function () {
+ var bindings = this._cfg.bind;
+ var binding = bindings.disabled;
+ if (binding) {
+ var newValue = this._transform(binding.transform, binding.inside[binding.to], "toWidget");
+ if (aria.utils.Type.isBoolean(newValue)) {
+ this._domElt.disabled = newValue;
+ } else {
+ aria.utils.Json.setValue(binding.inside, binding.to, this._domElt.disabled);
+ }
+ }
+ },
+
+ /**
+ * Function called when a value inside 'bind' has changed. It only deals with the case in which the bound
+ * property is 'disabled'
+ * @param {String} name Name of the property
+ * @param {Object} value Value of the changed property
+ * @param {Object} oldValue Value of the property before the change happened
+ */
+ onDisabledBind : function (name, value, oldValue) {
+ if (name === "disabled") {
+ this._domElt.disabled = value;
+ }
+ }
+
+ }
+});
View
37 src/aria/html/InputElement.js
@@ -21,6 +21,7 @@
Aria.classDefinition({
$classpath : "aria.html.InputElement",
$extends : "aria.html.Element",
+ $dependencies : ["aria.html.DisabledTrait"],
$statics : {
INVALID_USAGE : "Widget %1 can only be used as a %2.",
BINDING_NEEDED : "The property '%2' from Widget %1 should be bound to a data model"
@@ -33,6 +34,21 @@
this.$Element.constructor.call(this, cfg, context, line);
},
$prototype : {
+
+ /**
+ * Prototype init method called at prototype creation. It copies all methods from the prototype of
+ * aria.html.DisabledTrait
+ * @param {Object} p the prototype object being built
+ */
+ $init : function (p) {
+ var src = aria.html.DisabledTrait.prototype;
+ for (var key in src) {
+ if (src.hasOwnProperty(key) && !p.hasOwnProperty(key)) {
+ p[key] = src[key];
+ }
+ }
+ },
+
/**
* Input elements can only be used as self closing tags. Calling this function raises an error.
* @param {aria.templates.MarkupWriter} out
@@ -46,7 +62,26 @@
* because it was already logged by writeMarkupBegin.
* @param {aria.templates.MarkupWriter} out
*/
- writeMarkupEnd : Aria.empty
+ writeMarkupEnd : Aria.empty,
+
+ /**
+ * Initialization method called after the markup of the widget has been inserted in the DOM.
+ */
+ initWidget : function () {
+ this.$Element.initWidget.call(this);
+ this.initDisabledWidgetAttribute();
+ },
+
+ /**
+ * Function called when a value inside 'bind' has changed.
+ * @param {String} name Name of the property
+ * @param {Object} value Value of the changed property
+ * @param {Object} oldValue Value of the property before the change happened
+ */
+ onbind : function (name, value, oldValue) {
+ this.$Element.onbind.apply(this, arguments);
+ this.onDisabledBind(name, value, oldValue);
+ }
}
});
View
3  src/aria/html/RadioButton.js
@@ -51,7 +51,7 @@
* Initialization method called after the markup of the widget has been inserted in the DOM.
*/
initWidget : function () {
- this.$Element.initWidget.call(this);
+ this.$InputElement.initWidget.call(this);
var bindings = this._cfg.bind;
var binding = bindings.selectedValue;
@@ -70,6 +70,7 @@
* @param {Object} oldValue Value of the property before the change happened
*/
onbind : function (name, value, oldValue) {
+ this.$InputElement.onbind.apply(this, arguments);
if (name === "selectedValue") {
this._domElt.checked = (value === this._cfg.value);
}
View
22 src/aria/html/Select.js
@@ -22,7 +22,7 @@ Aria.classDefinition({
BINDING_NEEDED : "The property '%2' from Widget %1 should be bound to a data model",
WRONG_OPTIONS : "Can't use the options property if an html body content is defined for %1"
},
- $dependencies : ["aria.html.beans.SelectCfg"],
+ $dependencies : ["aria.html.beans.SelectCfg", "aria.utils.Type", "aria.html.DisabledTrait"],
$constructor : function (cfg, context, line) {
this.$cfgBean = this.$cfgBean || "aria.html.beans.SelectCfg.Properties";
@@ -38,6 +38,21 @@ Aria.classDefinition({
this.$Element.constructor.call(this, cfg, context, line);
},
$prototype : {
+
+ /**
+ * Prototype init method called at prototype creation time Allows to store class-level objects that are shared
+ * by all instances
+ * @param {Object} p the prototype object being built
+ */
+ $init : function (p) {
+ var src = aria.html.DisabledTrait.prototype;
+ for (var key in src) {
+ if (src.hasOwnProperty(key) && !p.hasOwnProperty(key)) {
+ p[key] = src[key];
+ }
+ }
+ },
+
/**
* @param {aria.templates.MarkupWriter} out
*/
@@ -124,6 +139,7 @@ Aria.classDefinition({
if (newIndex != null) {
this._domElt.selectedIndex = newIndex;
}
+ this.initDisabledWidgetAttribute();
},
/**
@@ -186,10 +202,12 @@ Aria.classDefinition({
if (name === "selectedIndex") {
this._domElt.selectedIndex = value;
this.setValueInDataModel();
- } else if (name === "value") {
+ }
+ if (name === "value") {
this._domElt.selectedIndex = this.getIndex(value);
this.setIndexInDataModel();
}
+ this.onDisabledBind(name, value, oldValue);
},
/**
View
4 src/aria/html/TextInput.js
@@ -239,7 +239,7 @@
* Initialization method called after the markup of the widget has been inserted in the DOM.
*/
initWidget : function () {
- this.$Element.initWidget.call(this);
+ this.$InputElement.initWidget.call(this);
var bindings = this._cfg.bind;
if (bindings.value) {
@@ -250,7 +250,6 @@
} else {
this.$logWarn(this.BINDING_NEEDED, [this.$class, "value"]);
}
-
this._setPlaceholder();
},
@@ -261,6 +260,7 @@
* @param {Object} oldValue Value of the property before the change happened
*/
onbind : function (name, value, oldValue) {
+ this.$InputElement.onbind.apply(this, arguments);
if (name === "value") {
value = (value != null) ? value + "" : "";
if (value) {
View
2  src/aria/html/beans/CheckBoxCfg.js
@@ -13,7 +13,7 @@ Aria.beanDefinitions({
$package : "aria.html.beans.CheckBoxCfg",
$description : "Configuration for CheckBox widget.",
$namespaces : {
- "base" : "aria.html.beans.ElementCfg",
+ "base" : "aria.html.beans.InputElementCfg",
"common" : "aria.widgetLibs.CommonBeans"
},
$beans : {
View
36 src/aria/html/beans/InputElementCfg.js
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2012 Amadeus s.a.s. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ * file except in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+Aria.beanDefinitions({
+ $package : "aria.html.beans.InputElementCfg",
+ $description : "Configuration for the generic InputElement.",
+ $namespaces : {
+ "base" : "aria.html.beans.ElementCfg",
+ "common" : "aria.widgetLibs.CommonBeans"
+ },
+ $beans : {
+ "Properties" : {
+ $type : "base:Properties",
+ $description : "Properties of an InputElement.",
+ $properties : {
+ "bind" : {
+ $type : "base:Properties.bind",
+ $properties : {
+ "disabled" : {
+ $type : "common:BindingRef",
+ $description : "Binding for the disabled attribute of the input element."
+ }
+ }
+ }
+ }
+ }
+ }
+});
View
2  src/aria/html/beans/RadioButtonCfg.js
@@ -14,7 +14,7 @@ Aria.beanDefinitions({
$description : "Configuration for RadioButton widget.",
$namespaces : {
"json" : "aria.core.JsonTypes",
- "base" : "aria.html.beans.ElementCfg",
+ "base" : "aria.html.beans.InputElementCfg",
"common" : "aria.widgetLibs.CommonBeans"
},
$beans : {
View
8 src/aria/html/beans/SelectCfg.js
@@ -44,7 +44,7 @@ Aria.beanDefinitions({
$default : []
},
"bind" : {
- $type : "base:Properties.$properties.bind",
+ $type : "base:Properties.bind",
$properties : {
"selectedIndex" : {
$type : "common:BindingRef",
@@ -53,6 +53,10 @@ Aria.beanDefinitions({
"value" : {
$type : "common:BindingRef",
$description : "Bi-directional binding on the selected value"
+ },
+ "disabled" : {
+ $type : "common:BindingRef",
+ $description : "Binding for the disabled attribute of the select element."
}
}
}
@@ -82,7 +86,7 @@ Aria.beanDefinitions({
$mandatory : true
},
"attributes" : {
- $type: "html:HtmlAttribute",
+ $type : "html:HtmlAttribute",
$description : "a list of attributes for the option tags"
}
}
View
3  src/aria/html/beans/TextInputCfg.js
@@ -19,6 +19,7 @@ Aria.beanDefinitions({
$namespaces : {
"json" : "aria.core.JsonTypes",
"base" : "aria.html.beans.ElementCfg",
+ "baseInput" : "aria.html.beans.InputElementCfg",
"common" : "aria.widgetLibs.CommonBeans"
},
$beans : {
@@ -32,7 +33,7 @@ Aria.beanDefinitions({
$mandatory : true
},
"bind" : {
- $type : "base:Properties.bind",
+ $type : "baseInput:Properties.bind",
$properties : {
"value" : {
$type : "common:BindingRef",
View
131 test/aria/html/DisabledTraitTest.js
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Aria.classDefinition({
+ $classpath : "test.aria.html.DisabledTraitTest",
+ $extends : "aria.jsunit.WidgetTestCase",
+ $dependencies : ["aria.html.Select", "aria.html.CheckBox", "aria.html.RadioButton", "aria.html.TextInput",
+ "aria.utils.Json"],
+ $prototype : {
+
+ testDisabledBinding : function () {
+
+ var container = {
+ disabled : true,
+ value : ""
+ };
+
+ var cfg = {
+ bind : {
+ disabled : {
+ inside : container,
+ to : "disabled"
+ }
+ }
+ };
+
+ this._select = this.createAndInit("aria.html.Select", cfg);
+ this._checkBox = this.createAndInit("aria.html.CheckBox", cfg);
+ this._radioButton = this.createAndInit("aria.html.RadioButton", cfg);
+ this._textInput = this.createAndInit("aria.html.TextInput", cfg);
+
+ this._assertDisabled(true);
+ aria.utils.Json.setValue(container, "disabled", false);
+ this._assertDisabled(false);
+
+ this._disposeCreatedWidgets();
+ },
+
+ testDisabledBindingInitTrue : function () {
+
+ var container = {};
+
+ var cfg = {
+ bind : {
+ disabled : {
+ inside : container,
+ to : "disabled"
+ }
+ }
+ };
+
+ this._select = this.createAndInit("aria.html.Select", cfg);
+ this._checkBox = this.createAndInit("aria.html.CheckBox", cfg);
+ this._radioButton = this.createAndInit("aria.html.RadioButton", cfg);
+ this._textInput = this.createAndInit("aria.html.TextInput", cfg);
+
+ this._assertDisabled(false);
+
+ this._disposeCreatedWidgets();
+ },
+
+ testDisabledBindingInitFalse : function () {
+
+ var container = {};
+
+ var cfg = {
+ bind : {
+ disabled : {
+ inside : container,
+ to : "disabled"
+ }
+ }
+ };
+
+ var cfgTwo = {
+ bind : {
+ disabled : {
+ inside : container,
+ to : "disabled"
+ }
+ },
+ attributes : {
+ disabled : "disabled"
+ }
+ };
+
+ this._select = this.createAndInit("aria.html.Select", cfgTwo);
+ this._checkBox = this.createAndInit("aria.html.CheckBox", cfg);
+ this._radioButton = this.createAndInit("aria.html.RadioButton", cfg);
+ this._textInput = this.createAndInit("aria.html.TextInput", cfg);
+
+ this._assertDisabled(true);
+ aria.utils.Json.setValue(container, "disabled", false);
+ this._assertDisabled(false);
+
+ this._disposeCreatedWidgets();
+ },
+
+ _assertDisabled : function (value) {
+ var additionalText = value ? "" : "not ";
+ this.assertEquals(this._select._domElt.disabled, value, "Select should" + additionalText + " be disabled");
+ this.assertEquals(this._checkBox._domElt.disabled, value, "CheckBox should" + additionalText
+ + " be disabled");
+ this.assertEquals(this._radioButton._domElt.disabled, value, "radioButton should" + additionalText
+ + " be disabled");
+ this.assertEquals(this._textInput._domElt.disabled, value, "textInput should" + additionalText
+ + " be disabled");
+ },
+
+ _disposeCreatedWidgets : function () {
+ this._select.$dispose();
+ this._checkBox.$dispose();
+ this._radioButton.$dispose();
+ this._textInput.$dispose();
+ this.outObj.clearAll();
+ }
+
+ }
+});
View
1  test/aria/html/HTMLTestSuite.js
@@ -27,5 +27,6 @@ Aria.classDefinition({
this.addTests("test.aria.html.radioButton.RadioButtonTest");
this.addTests("test.aria.html.select.SelectTest");
this.addTests("test.aria.html.select.bodycontent.BodyContentTestCase");
+ this.addTests("test.aria.html.DisabledTraitTest");
}
});
View
17 test/aria/html/checkbox/CheckBoxTest.js
@@ -15,9 +15,12 @@
Aria.classDefinition({
$classpath : "test.aria.html.checkbox.CheckBoxTest",
- $extends : "aria.jsunit.WidgetTestCase",
- $dependencies : ["aria.html.CheckBox", "aria.utils.json", "aria.utils.FireDomEvent"],
+ $extends : "test.aria.html.inputElement.InputElementBaseTest",
+ $dependencies : ["aria.html.CheckBox", "aria.utils.Json", "aria.utils.FireDomEvent"],
$prototype : {
+
+ _widgetClass : "aria.html.CheckBox",
+
testInitialValueFalse : function () {
var container = {};
@@ -32,7 +35,8 @@ Aria.classDefinition({
var widget = this.createAndInit("aria.html.CheckBox", cfg);
- this.assertEquals(widget._domElt.checked, false, "Checked bound to initial false: " + widget._domElt.checked);
+ this.assertEquals(widget._domElt.checked, false, "Checked bound to initial false: "
+ + widget._domElt.checked);
aria.utils.Json.setValue(container, "checkstate", true);
this.assertEquals(widget._domElt.checked, true, "Set checked to true: " + widget._domElt.checked);
@@ -77,10 +81,10 @@ Aria.classDefinition({
inside : container,
to : "checkstate",
transform : {
- fromWidget : function(v) {
+ fromWidget : function (v) {
return v ? 'checked' : 'not_checked';
},
- toWidget : function(v) {
+ toWidget : function (v) {
return v === 'checked';
}
}
@@ -121,6 +125,5 @@ Aria.classDefinition({
widget.$dispose();
this.outObj.clearAll();
}
-
- }
+ }
});
View
123 test/aria/html/inputElement/InputElementBaseTest.js
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Aria.classDefinition({
+ $classpath : "test.aria.html.inputElement.InputElementBaseTest",
+ $extends : "aria.jsunit.WidgetTestCase",
+ $dependencies : ["aria.html.InputElement", "aria.utils.Json"],
+ $statics : {
+ WIDGET_CLASS_NOT_SET : "Property _widgetClass has not been properly set. Beware: this test cannot be executed by itslef, it has to be extended."
+ },
+ $prototype : {
+
+ /**
+ * Class of the widget to test. It must be set in the inheriting test class
+ * @type String
+ * @protected
+ */
+ _widgetClass : null,
+
+ testDisabledBinding : function () {
+
+ if (!this._widgetClass) {
+ this.$logError(this.WIDGET_CLASS_NOT_SET);
+ return;
+ }
+ var container = {
+ disabled : true
+ };
+
+ var cfg = {
+ bind : {
+ disabled : {
+ inside : container,
+ to : "disabled"
+ }
+ }
+ };
+
+ var widget = this.createAndInit(this._widgetClass, cfg);
+
+ this.assertEquals(widget._domElt.disabled, true, "CheckBox should be disabled");
+
+ aria.utils.Json.setValue(container, "disabled", false);
+ this.assertEquals(widget._domElt.disabled, false, "CheckBox should not be disabled");
+
+ widget.$dispose();
+ this.outObj.clearAll();
+ },
+
+ testDisabledInitialTrueValue : function () {
+ if (!this._widgetClass) {
+ this.$logError(this.WIDGET_CLASS_NOT_SET);
+ return;
+ }
+
+ var container = {};
+
+ var cfg = {
+ bind : {
+ disabled : {
+ inside : container,
+ to : "disabled"
+ }
+ },
+ attributes : {
+ disabled : "disabled"
+ }
+ };
+
+ var widget = this.createAndInit(this._widgetClass, cfg);
+
+ this.assertEquals(widget._domElt.disabled, true, "CheckBox should be disabled");
+ this.assertEquals(container.disabled, true, "Data model bound to \"disabled\" should be set to true");
+
+ aria.utils.Json.setValue(container, "disabled", false);
+ this.assertEquals(widget._domElt.disabled, false, "CheckBox should not be disabled");
+
+ widget.$dispose();
+ this.outObj.clearAll();
+ },
+
+ testDisabledInitialFalseValue : function () {
+ if (!this._widgetClass) {
+ this.$logError(this.WIDGET_CLASS_NOT_SET);
+ return;
+ }
+
+ var container = {
+ disabled : "invalidType"
+ };
+
+ var cfg = {
+ bind : {
+ disabled : {
+ inside : container,
+ to : "disabled"
+ }
+ }
+ };
+
+ var widget = this.createAndInit(this._widgetClass, cfg);
+
+ this.assertEquals(widget._domElt.disabled, false, "CheckBox should not be disabled");
+ this.assertEquals(container.disabled, false, "Data model bound to \"disabled\" should be set to false");
+
+ widget.$dispose();
+ this.outObj.clearAll();
+ }
+
+ }
+});
View
6 test/aria/html/radioButton/RadioButtonTest.js
@@ -15,10 +15,12 @@
Aria.classDefinition({
$classpath : "test.aria.html.radioButton.RadioButtonTest",
- $extends : "aria.jsunit.WidgetTestCase",
- $dependencies : ["aria.html.RadioButton", "aria.utils.json", "aria.utils.FireDomEvent"],
+ $extends : "test.aria.html.inputElement.InputElementBaseTest",
+ $dependencies : ["aria.html.RadioButton", "aria.utils.Json", "aria.utils.FireDomEvent"],
$prototype : {
+ _widgetClass : "aria.html.RadioButton",
+
testWithoutInitialValue : function () {
var container = {};
View
12 test/aria/html/select/SelectTest.js
@@ -15,10 +15,12 @@
Aria.classDefinition({
$classpath : "test.aria.html.select.SelectTest",
- $extends : "aria.jsunit.WidgetTestCase",
- $dependencies : ["aria.html.Select", "aria.utils.json", "aria.utils.FireDomEvent", "aria.utils.SynEvents"],
+ $extends : "test.aria.html.inputElement.InputElementBaseTest",
+ $dependencies : ["aria.html.Select", "aria.utils.Json", "aria.utils.FireDomEvent", "aria.utils.SynEvents"],
$prototype : {
+ _widgetClass : "aria.html.Select",
+
testWithoutInitialIndex : function () {
var container = {};
@@ -430,10 +432,10 @@ Aria.classDefinition({
this.outObj.clearAll();
},
- testWithBothValueAndIndexBound : function () {
+ testWithBothValueAndIndexBound : function () {
var container = {
"item" : "FR",
- index: 0
+ index : 0
};
var bindingConfig = {
@@ -471,7 +473,7 @@ Aria.classDefinition({
this.assertEquals(selectWidget._domElt.selectedIndex, 1, "The selected Index should be %2 but was %1 ");
- //the model should have been updated as well
+ // the model should have been updated as well
this.assertEquals(container.index, 1, "The Index in the data model should be %2 but was %1 ");
selectWidget.$dispose();
View
23 test/aria/html/textinput/DisabledTextInputTest.js
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Aria.classDefinition({
+ $classpath : "test.aria.html.textinput.DisabledTextInputTest",
+ $extends : "test.aria.html.inputElement.InputElementBaseTest",
+ $dependencies : ["aria.html.TextInput"],
+ $prototype : {
+ _widgetClass : "aria.html.TextInput"
+ }
+});
View
1  test/aria/html/textinput/TextInputTestSuite.js
@@ -27,5 +27,6 @@ Aria.classDefinition({
this.addTests("test.aria.html.textinput.placeholder.PlaceholderTestCase");
this.addTests("test.aria.html.textinput.bind.BindableTestCase");
this.addTests("test.aria.html.textinput.bind.TextInputBindTest");
+ this.addTests("test.aria.html.textinput.DisabledTextInputTest");
}
});
Something went wrong with that request. Please try again.