You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/10/11 23:59:23 UTC

[1/2] git commit: [flex-asjs] [refs/heads/develop] - try to get jquery app to run

Updated Branches:
  refs/heads/develop 6036d5d35 -> 17947a07f


try to get jquery app to run


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/be258c2d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/be258c2d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/be258c2d

Branch: refs/heads/develop
Commit: be258c2dd6a062a6f92ba58dc057ebca6735657e
Parents: 6036d5d
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 11 11:49:28 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 11 11:49:28 2013 -0700

----------------------------------------------------------------------
 frameworks/as/defaults.css                              | 2 ++
 frameworks/as/src/org/apache/flex/jquery/Application.as | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/be258c2d/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index a220dc7..23a9bf5 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -343,6 +343,7 @@ h5|ComboBox
 
 jq|TextButton
 {
+    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.TextModel");
     IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.TextButtonView");
 }
 
@@ -363,6 +364,7 @@ jq|RadioButton
 
 createjs|TextButton
 {
+    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.TextModel");
     IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.TextButtonView");
 }
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/be258c2d/frameworks/as/src/org/apache/flex/jquery/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/jquery/Application.as b/frameworks/as/src/org/apache/flex/jquery/Application.as
index aec704f..e2a3113 100644
--- a/frameworks/as/src/org/apache/flex/jquery/Application.as
+++ b/frameworks/as/src/org/apache/flex/jquery/Application.as
@@ -19,8 +19,9 @@
 package org.apache.flex.jquery
 {
     import org.apache.flex.core.Application;
+	import org.apache.flex.core.IFlexInfo;
 	
-	public class Application extends org.apache.flex.core.Application
+	public class Application extends org.apache.flex.core.Application implements IFlexInfo
 	{
 		public function Application()
 		{


[2/2] git commit: [flex-asjs] [refs/heads/develop] - repair DataBindingTest

Posted by ah...@apache.org.
repair DataBindingTest


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/17947a07
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/17947a07
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/17947a07

Branch: refs/heads/develop
Commit: 17947a07f782c8c5fbbb8cb63451b099e8e90301
Parents: be258c2
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 11 14:59:05 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 11 14:59:05 2013 -0700

----------------------------------------------------------------------
 .../flex/html/staticControls/DropDownList.js    | 74 ++++++++++++++++++++
 .../beads/layouts/NonVirtualHorizontalLayout.js |  6 +-
 .../beads/models/ArraySelectionModel.js         | 12 +++-
 3 files changed, 85 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/17947a07/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/DropDownList.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/DropDownList.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/DropDownList.js
index e5c9a31..341b3c2 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/DropDownList.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/DropDownList.js
@@ -24,6 +24,80 @@ goog.require('org.apache.flex.core.ListBase');
  */
 org.apache.flex.html.staticControls.DropDownList = function() {
   goog.base(this);
+  this.model =
+     new org.apache.flex.html.staticControls.beads.models.ArraySelectionModel();
+
 };
 goog.inherits(org.apache.flex.html.staticControls.DropDownList,
     org.apache.flex.core.ListBase);
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.DropDownList}
+ */
+org.apache.flex.html.staticControls.DropDownList.prototype.
+createElement = function() {
+  this.element = document.createElement('select');
+  this.element.size = 1;
+  goog.events.listen(this.element, 'change',
+    goog.bind(this.changeHandler, this));
+  this.positioner = this.element;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.DropDownList}
+ * @param {Object} value The new dataProvider.
+ */
+org.apache.flex.html.staticControls.DropDownList.prototype.
+set_dataProvider = function(value) {
+  var dp, i, n, opt;
+
+  this.model.set_dataProvider(value);
+
+  dp = this.element.options;
+  n = dp.length;
+  for (i = 0; i < n; i++) {
+    dp.remove(0);
+  }
+
+  n = value.length;
+  for (i = 0; i < n; i++) {
+    opt = document.createElement('option');
+    opt.text = value[i];
+    dp.add(opt);
+  }
+
+};
+
+/**
+ * @protected
+ * @this {org.apache.flex.html.staticControls.DropDownList}
+ */
+org.apache.flex.html.staticControls.DropDownList.prototype.changeHandler =
+    function() {
+  this.model.set_selectedIndex(this.element.selectedIndex);
+  this.dispatchEvent('change');
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.DropDownList}
+ * @param {Number} value The new selected index.
+ */
+org.apache.flex.html.staticControls.DropDownList.prototype.
+set_selectedIndex = function(value) {
+   this.model.set_selectedIndex(value);
+   this.element.selectedIndex = value;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.DropDownList}
+ * @param {Object} value The new selected item.
+ */
+org.apache.flex.html.staticControls.DropDownList.prototype.
+set_selectedItem = function(value) {
+   this.model.set_selectedItem(value);
+   this.element.selectedIndex = this.get_selectedIndex();
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/17947a07/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js
index a9f29a0..535e2af 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js
@@ -58,11 +58,7 @@ org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout.
 prototype.changeHandler = function(event) {
   var children, i, n;
 
-  var layoutParent = this.strand_.getBeadByType(
-      org.apache.flex.html.staticControls.beads.ListView);
-  var contentView = layoutParent.get_dataGroup();
-
-  children = contentView.internalChildren();
+  children = this.strand_.internalChildren();
   n = children.length;
   for (i = 0; i < n; i++)
   {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/17947a07/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ArraySelectionModel.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ArraySelectionModel.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ArraySelectionModel.js
index 12944a1..099aefe 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ArraySelectionModel.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/ArraySelectionModel.js
@@ -93,7 +93,16 @@ set_selectedIndex = function(value) {
  */
 org.apache.flex.html.staticControls.beads.models.ArraySelectionModel.prototype.
 get_selectedItem = function() {
-  return this.selectedItem_;
+  var si;
+
+  si = this.selectedIndex_;
+
+  if (!this.dataProvider_ || si < 0 ||
+      si >= this.dataProvider_.length) {
+    return null;
+  }
+
+  return this.dataProvider_[si];
 };
 
 
@@ -104,7 +113,6 @@ get_selectedItem = function() {
  */
 org.apache.flex.html.staticControls.beads.models.ArraySelectionModel.prototype.
 set_selectedItem = function(value) {
-  this.selectedItem_ = value;
   // find item in dataProvider and set selectedIndex or -1 if not exists
 
   this.selectedIndex_ = -1;