Skip to content

HTML checkbox widget #285

Closed
wants to merge 1 commit into from

2 participants

@olaf-k
Aria Templates member
olaf-k commented Dec 14, 2012

This adds a very simple checkbox widget to the HTML library. Its only ability is a double-binding on its "checked" property.

@piuccio piuccio commented on an outdated diff Dec 18, 2012
src/aria/html/CheckBox.js
+ INVALID_USAGE : "Widget %1 can only be used as a %2."
+ },
+ $constructor : function(cfg, context, line) {
+ this.$cfgBean = "aria.html.beans.CheckBoxCfg.Properties";
+
+ cfg.tagName = "input";
+ cfg.attributes = cfg.attributes || {};
+ cfg.attributes.type = "checkbox";
+ cfg.on = cfg.on || {};
+
+ this._registerChange(cfg.on, context);
+
+ this.$Element.constructor.call(this, cfg, context, line);
+ },
+ $destructor : function() {
+ this.$Element.$destructor.call(this);
@piuccio
piuccio added a note Dec 18, 2012

It's useless to define a $destructor if then you simply call the parent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@piuccio piuccio and 1 other commented on an outdated diff Dec 18, 2012
src/aria/html/CheckBox.js
+ *
+ * @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) {
+ if (name === "checked") {
+ this._domElt.checked = value;
+ }
+ },
+
+ /**
+ * OK, listen, I honestly have no idea what this does since I copied/pasted it from TextInput.js, but it's
@piuccio
piuccio added a note Dec 18, 2012

RLY??

@olaf-k
Aria Templates member
olaf-k added a note Dec 18, 2012

not my fault
that's Honest Driven Development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@olaf-k olaf-k added a commit that referenced this pull request Jan 8, 2013
@olaf-k olaf-k feat #285 Created a simple HTML checkbox widget 0476a8c
@piuccio
piuccio commented Jan 8, 2013

Integrated in 0476a8c

@piuccio piuccio closed this Jan 8, 2013
@olaf-k olaf-k deleted the unknown repository branch Jan 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.