Peter,
I see that model is undefined after your fix in Chrome.
Uncaught TypeError: Type Coercion failed
at Function.org.apache.flex.utils.Language.as (Language.js:76)
at org.apache.flex.html.Alert.set__message (Alert.js:217)
at Function.org.apache.flex.html.Alert.show (Alert.js:158)
Piotr
2017-01-24 20:49 GMT+01:00 <[email protected]>:
> Repository: flex-asjs
> Updated Branches:
> refs/heads/develop a09ca580f -> b22fcdbaf
>
>
> Fixed layout bugs in Alert.
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b22fcdba
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b22fcdba
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b22fcdba
>
> Branch: refs/heads/develop
> Commit: b22fcdbafb21ec56588f2d04567703eb1d6a1bab
> Parents: a09ca58
> Author: Peter Ent <[email protected]>
> Authored: Tue Jan 24 14:49:06 2017 -0500
> Committer: Peter Ent <[email protected]>
> Committed: Tue Jan 24 14:49:06 2017 -0500
>
> ----------------------------------------------------------------------
> .../projects/HTML/src/main/flex/HTMLClasses.as | 1 +
> .../src/main/flex/org/apache/flex/html/Alert.as | 35 ++++++++++++++++++--
> .../org/apache/flex/html/beads/AlertView.as | 9 ++---
> 3 files changed, 38 insertions(+), 7 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> b22fcdba/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
> ----------------------------------------------------------------------
> diff --git a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
> b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
> index 35f2a98..ee5f4aa 100644
> --- a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
> +++ b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
> @@ -92,6 +92,7 @@ internal class HTMLClasses
> import org.apache.flex.html.beads.TextInputWithBorderView;
> TextInputWithBorderView;
> import org.apache.flex.html.beads.models.AlertModel;
> AlertModel;
> }
> + import org.apache.flex.html.beads.models.AlertModel; AlertModel;
> import org.apache.flex.html.beads.models.ArraySelectionModel;
> ArraySelectionModel;
> import org.apache.flex.html.beads.models.ArrayListSelectionModel;
> ArrayListSelectionModel;
> import org.apache.flex.html.beads.models.RangeModel; RangeModel;
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> b22fcdba/frameworks/projects/HTML/src/main/flex/org/apache/
> flex/html/Alert.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as
> b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as
> index 4a8028f..82665d5 100644
> --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as
> +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as
> @@ -126,16 +126,34 @@ package org.apache.flex.html
>
> // add in a title bar
> titleBar = new TitleBar();
> + titleBar.percentWidth = 100;
> + titleBar.height = 24;
> addElement(titleBar);
> titleBar.element.id = 'titleBar';
> + titleBar.element.style.top = "0px";
> + titleBar.element.style.right = "0px";
> + titleBar.element.style.left = "0px";
> + titleBar.element.style.marginBottom = "6px";
>
> label = new Label();
> addElement(label);
> + label.element.style.display = "block";
> + label.element.style.padding = "6px";
> + label.element.style.left = "0px";
> + label.element.style.right = "0px";
> + label.element.style.whiteSpace = "normal";
> label.element.id = 'message';
>
> // add a place for the buttons
> buttonArea = new Container();
> + buttonArea.percentWidth = 100;
> + buttonArea.height = 28;
> addElement(buttonArea);
> + buttonArea.element.style.marginTop = "6px";
> + buttonArea.element.style.marginBottom = "6px";
> + buttonArea.element.style.padding = "2px";
> + buttonArea.element.style.left = "0px";
> + buttonArea.element.style.right = "0px";
> buttonArea.element.id = 'buttonArea';
>
> return element;
> @@ -169,10 +187,9 @@ package org.apache.flex.html
>
> COMPILE::JS
> {
> - alert.positioner.style.position = 'relative';
> - alert.positioner.style.width = '200px';
> alert.positioner.style.margin = 'auto';
> - alert.positioner.style.top = '100px';
> + alert.positioner.style.left = "50%";
> + alert.positioner.style.top = "50%";
> }
> }
>
> @@ -207,6 +224,10 @@ package org.apache.flex.html
> public function set title(value:String):void
> {
> IAlertModel(model).title = value;
> +
> + COMPILE::JS {
> + titleBar.title = value;
> + }
> }
>
> /**
> @@ -224,6 +245,10 @@ package org.apache.flex.html
> public function set message(value:String):void
> {
> IAlertModel(model).message = value;
> +
> + COMPILE::JS {
> + label.text = value;
> + }
> }
>
> /**
> @@ -249,24 +274,28 @@ package org.apache.flex.html
> var ok:TextButton = new TextButton();
> buttonArea.addElement(ok);
> ok.text = 'OK';
> + ok.element.style.margin = "4px";
> goog.events.listen(ok.element, 'click', dismissAlert);
> }
> if (flags & Alert.CANCEL) {
> var cancel:TextButton = new TextButton();
> buttonArea.addElement(cancel);
> cancel.text = 'Cancel';
> + cancel.element.style.margin =
> "4px";
> goog.events.listen(cancel.element, 'click',
> dismissAlert);
> }
> if (flags & Alert.YES) {
> var yes:TextButton = new TextButton();
> buttonArea.addElement(yes);
> yes.text = 'YES';
> + yes.element.style.margin = "4px";
> goog.events.listen(yes.element, 'click',
> dismissAlert);
> }
> if (flags & Alert.NO) {
> var nob:TextButton = new TextButton();
> buttonArea.addElement(nob);
> nob.text = 'NO';
> + nob.element.style.margin = "4px";
> goog.events.listen(nob.element, 'click',
> dismissAlert);
> }
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> b22fcdba/frameworks/projects/HTML/src/main/flex/org/apache/
> flex/html/beads/AlertView.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertView.as
> b/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/beads/AlertView.as
> index dedf5a1..ed81898 100644
> --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/beads/AlertView.as
> +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/beads/AlertView.as
> @@ -28,6 +28,7 @@ package org.apache.flex.html.beads
> import org.apache.flex.core.UIBase;
> import org.apache.flex.core.ValuesManager;
> import org.apache.flex.events.Event;
> + import org.apache.flex.events.MouseEvent;
> import org.apache.flex.events.IEventDispatcher;
> import org.apache.flex.geom.Rectangle;
> import org.apache.flex.html.Alert;
> @@ -183,7 +184,7 @@ package org.apache.flex.html.beads
> /**
> * @private
> */
> - private function handleOK(event:Event):void
> + private function handleOK(event:MouseEvent):void
> {
> // create some custom event where the detail value
> // is the OK button flag. Do same for other event
> handlers
> @@ -193,7 +194,7 @@ package org.apache.flex.html.beads
> /**
> * @private
> */
> - private function handleCancel(event:Event):void
> + private function handleCancel(event:MouseEvent):void
> {
> dispatchCloseEvent(Alert.CANCEL);
> }
> @@ -201,7 +202,7 @@ package org.apache.flex.html.beads
> /**
> * @private
> */
> - private function handleYes(event:Event):void
> + private function handleYes(event:MouseEvent):void
> {
> dispatchCloseEvent(Alert.YES);
> }
> @@ -209,7 +210,7 @@ package org.apache.flex.html.beads
> /**
> * @private
> */
> - private function handleNo(event:Event):void
> + private function handleNo(event:MouseEvent):void
> {
> dispatchCloseEvent(Alert.NO);
> }
>
>
--
Greetings
Piotr Zarzycki
Flex/AIR/.NET Developer
mobile: +48 880 859 557
e-mail: [email protected]
skype: zarzycki10
LinkedIn: http://www.linkedin.com/piotrzarzycki
<https://pl.linkedin.com/in/piotr-zarzycki-92a53552>