You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2013/03/07 18:41:06 UTC
svn commit: r1453978 - in
/flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls:
RadioButton.js beads/RadioButtonBead.js
beads/models/ValueToggleButtonModel.js
Author: pent
Date: Thu Mar 7 17:41:05 2013
New Revision: 1453978
URL: http://svn.apache.org/r1453978
Log:
JavaScript RadioButton
Added:
flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js (with props)
flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/RadioButtonBead.js (with props)
flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ValueToggleButtonModel.js (with props)
Added: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js?rev=1453978&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js (added)
+++ flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js Thu Mar 7 17:41:05 2013
@@ -0,0 +1,108 @@
+/**
+ * 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.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.RadioButton');
+
+goog.require('org.apache.flex.core.UIBase');
+
+var rbCount = 0;
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.html.staticControls.RadioButton = function() {
+ org.apache.flex.core.UIBase.call(this);
+};
+goog.inherits(
+ org.apache.flex.html.staticControls.RadioButton, org.apache.flex.core.UIBase
+);
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.addToParent =
+ function(p) {
+ this.element = document.createElement('div');
+
+ var rb = document.createElement('input');
+ rb.type = 'radio';
+ rb.id = "rb"+(rbCount++);
+ this.element.appendChild(rb);
+
+ var label = document.createElement('label');
+ label.innerHTML = this.groupName;//"Radio Button";
+ label.setAttribute('for',rb.id);
+ this.element.appendChild(label);
+
+ p.appendChild(this.element);
+
+ this.positioner = this.element;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @return {string} The groupName getter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.get_groupName = function() {
+ return this.element.childNodes.item(0).name;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @param {string} value The groupName setter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.set_groupName = function(value) {
+ this.element.childNodes.item(0).name = value;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @return {string} The text getter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.get_text = function() {
+ return this.element.childNodes.item(1).innerHTML;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @param {string} value The text setter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.set_text = function(value) {
+ this.element.childNodes.item(1).innerHTML = value;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @return {bool} The selected getter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.get_selected = function() {
+ return this.element.childNodes.item(0).checked;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @param {bool} value The selected setter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.set_selected = function(value) {
+ this.element.childNodes.item(0).checked = value;
+};
Propchange: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/RadioButtonBead.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/RadioButtonBead.js?rev=1453978&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/RadioButtonBead.js (added)
+++ flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/RadioButtonBead.js Thu Mar 7 17:41:05 2013
@@ -0,0 +1,29 @@
+/**
+ * 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.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.RadioButtonBead');
+
+goog.require('org.apache.flex.FlexObject');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.FlexObject}
+ */
+org.apache.flex.html.staticControls.beads.RadioButtonBead = function() {
+ org.apache.flex.FlexObject.call(this);
+};
+goog.inherits(
+ org.apache.flex.html.staticControls.beads.RadioButtonBead,
+ org.apache.flex.FlexObject
+);
Propchange: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/RadioButtonBead.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ValueToggleButtonModel.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ValueToggleButtonModel.js?rev=1453978&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ValueToggleButtonModel.js (added)
+++ flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ValueToggleButtonModel.js Thu Mar 7 17:41:05 2013
@@ -0,0 +1,29 @@
+/**
+ * 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.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.models.ValueToggleButtonModel');
+
+goog.require('org.apache.flex.FlexObject');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.FlexObject}
+ */
+org.apache.flex.html.staticControls.beads.ValueToggleButtonModel = function() {
+ org.apache.flex.FlexObject.call(this);
+};
+goog.inherits(
+ org.apache.flex.html.staticControls.beads.ValueToggleButtonModel,
+ org.apache.flex.FlexObject
+);
Propchange: flex/asjs/branches/develop/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ValueToggleButtonModel.js
------------------------------------------------------------------------------
svn:eol-style = native