Re: git commit: [flex-asjs] [refs/heads/dual] - Basic: NumericStepper now accepts initial values for model, shares model with internal Spinner, and listens for changes to the model

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: git commit: [flex-asjs] [refs/heads/dual] - Basic: NumericStepper now accepts initial values for model, shares model with internal Spinner, and listens for changes to the model

piotrz
Hi Josh,

Shouldn't we have this one in the View part of component?

Thanks,
Piotr

On Sat, Apr 29, 2017, 01:03 <[hidden email]> wrote:

> Repository: flex-asjs
> Updated Branches:
>   refs/heads/dual eaba96161 -> 90764bc01
>
>
> Basic: NumericStepper now accepts initial values for model, shares model
> with internal Spinner, and listens for changes to the model
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/90764bc0
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/90764bc0
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/90764bc0
>
> Branch: refs/heads/dual
> Commit: 90764bc0130b5b619a223abc627ff2daab88429d
> Parents: eaba961
> Author: Josh Tynjala <[hidden email]>
> Authored: Fri Apr 28 16:03:12 2017 -0700
> Committer: Josh Tynjala <[hidden email]>
> Committed: Fri Apr 28 16:03:12 2017 -0700
>
> ----------------------------------------------------------------------
>  .../flex/org/apache/flex/html/NumericStepper.as    | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90764bc0/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/NumericStepper.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/NumericStepper.as
> b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/NumericStepper.as
> index 984fda9..876c597 100644
> ---
> a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/NumericStepper.as
> +++
> b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/NumericStepper.as
> @@ -24,6 +24,8 @@ package org.apache.flex.html
>      {
>          import goog.events;
>          import org.apache.flex.core.WrappedHTMLElement;
> +        import org.apache.flex.events.IEventDispatcher;
> +        import org.apache.flex.core.IBead;
>      }
>
>         [Event(name="valueChange", type="org.apache.flex.events.Event")]
> @@ -171,6 +173,7 @@ package org.apache.flex.html
>              input.positioner.style.width = '100px';
>
>              spinner = new Spinner();
> +                       spinner.addBead(model as IBead);
>              addElement(spinner);
>
>              /* TODO: ajh move to view and css */
> @@ -183,6 +186,12 @@ package org.apache.flex.html
>
>              input.text = String(spinner.value);
>
> +
>  IEventDispatcher(model).addEventListener("valueChange",modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("minimumChange",modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("maximumChange",modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("stepSizeChange",modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("snapIntervalChange",modelChangeHandler);
> +
>              return element;
>          }
>
> @@ -198,6 +207,14 @@ package org.apache.flex.html
>              dispatchEvent(new Event('valueChange'));
>          };
>
> +        /**
> +         * @private
> +         */
> +        COMPILE::JS
> +        private function modelChangeHandler(event:Event):void
> +        {
> +            input.text = String(model.value);
> +        }
>
>         }
>  }
>
>
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: git commit: [flex-asjs] [refs/heads/dual] - Basic: NumericStepper now accepts initial values for model, shares model with internal Spinner, and listens for changes to the model

Josh Tynjala
That was my original expectation too, but it looks like the JS
implementation doesn't have a view part while the SWF implementation does.

Peter added some thoughts about this in the other thread.

- Josh

On Apr 28, 2017 11:21 PM, "Piotr Zarzycki" <[hidden email]>
wrote:

Hi Josh,

Shouldn't we have this one in the View part of component?

Thanks,
Piotr

On Sat, Apr 29, 2017, 01:03 <[hidden email]> wrote:

> Repository: flex-asjs
> Updated Branches:
>   refs/heads/dual eaba96161 -> 90764bc01
>
>
> Basic: NumericStepper now accepts initial values for model, shares model
> with internal Spinner, and listens for changes to the model
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/90764bc0
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/90764bc0
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/90764bc0
>
> Branch: refs/heads/dual
> Commit: 90764bc0130b5b619a223abc627ff2daab88429d
> Parents: eaba961
> Author: Josh Tynjala <[hidden email]>
> Authored: Fri Apr 28 16:03:12 2017 -0700
> Committer: Josh Tynjala <[hidden email]>
> Committed: Fri Apr 28 16:03:12 2017 -0700
>
> ----------------------------------------------------------------------
>  .../flex/org/apache/flex/html/NumericStepper.as    | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
90764bc0/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/
NumericStepper.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/Basic/src/main/flex/org/apache/flex/
html/NumericStepper.as
> b/frameworks/projects/Basic/src/main/flex/org/apache/flex/
html/NumericStepper.as
> index 984fda9..876c597 100644
> ---
> a/frameworks/projects/Basic/src/main/flex/org/apache/flex/
html/NumericStepper.as
> +++
> b/frameworks/projects/Basic/src/main/flex/org/apache/flex/
html/NumericStepper.as

> @@ -24,6 +24,8 @@ package org.apache.flex.html
>      {
>          import goog.events;
>          import org.apache.flex.core.WrappedHTMLElement;
> +        import org.apache.flex.events.IEventDispatcher;
> +        import org.apache.flex.core.IBead;
>      }
>
>         [Event(name="valueChange", type="org.apache.flex.events.Event")]
> @@ -171,6 +173,7 @@ package org.apache.flex.html
>              input.positioner.style.width = '100px';
>
>              spinner = new Spinner();
> +                       spinner.addBead(model as IBead);
>              addElement(spinner);
>
>              /* TODO: ajh move to view and css */
> @@ -183,6 +186,12 @@ package org.apache.flex.html
>
>              input.text = String(spinner.value);
>
> +
>  IEventDispatcher(model).addEventListener("valueChange"
,modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("minimumChange",
modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("maximumChange",
modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("stepSizeChange",
modelChangeHandler);
> +
>  IEventDispatcher(model).addEventListener("snapIntervalChange",
modelChangeHandler);

> +
>              return element;
>          }
>
> @@ -198,6 +207,14 @@ package org.apache.flex.html
>              dispatchEvent(new Event('valueChange'));
>          };
>
> +        /**
> +         * @private
> +         */
> +        COMPILE::JS
> +        private function modelChangeHandler(event:Event):void
> +        {
> +            input.text = String(model.value);
> +        }
>
>         }
>  }
>
>
Loading...