You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Peter Ent <pe...@adobe.com> on 2017/02/01 14:16:28 UTC

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

I need to look into this more. My memory isn't what it used to be, so I do
not recall how this was taking place in CreateJS (React is a very
different thing), but that was also before the refactor wrapping Sprite.

The FlexJS/HTML/RadioButton JS code has no explicit event listener
attached to it. This is the embarrassing/mystery/memory part. When you
click on it, BrowserEvent appears and handles the event and pairs it up
with the RadioButton that was clicked. I don't know how this happens off
the top of my head.

In MDL, the events seem pretty straightforward. You've added a click
handler and that gets called two times: once for the <input> element and
once for the <span> (as target). I'm not 100% sure why that happens from
the google point of view, but I assume that since the MDL "radio" is
composed of several elements, you are getting an event per element. Since
some of the <span> element do not have text nodes, I am guessing they do
not generate events.

I will add an explicit event handler to the FlexJS/HTML/RadioButton and
see what happens and report back. Hopefully I'll have my memory jogged
enough to figure out how BrowserEvent is coming into play here. I have to
tell you, that having written this stuff and not remembering how it works,
is distressing!

‹peter


On 1/31/17, 6:32 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>Peter,
>
>to complement what Piotr said. MDL uses the js and css libs from google so
>as you click on the object I'm sure MDL handles it's own click (I assume
>that but didn't go low level to check it since we are creating MDL based
>on
>the structure they suggest, so with the tools they give). I think
>something
>like this should happen with CreateJS or ReactJS when you did your FlexJS
>integration?
>
>
>2017-02-01 0:06 GMT+01:00 piotrz <pi...@gmail.com>:
>
>> Peter,
>>
>> MDL RadioButton isn't get BrowserEvent. When I debugged it in the
>>browser
>> and had event listener on "label" I got two times this BrowserEvent - I
>> didn't fully understand your last sentence.
>>
>> What about native FlexJS RadioButton ? How it is working when you
>> addEventListener ?
>>
>> Piotr
>>
>>
>>
>> -----
>> Apache Flex PMC
>> piotrzarzycki21@gmail.com
>> --
>> View this message in context: http://apache-flex-
>> development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-
>> Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58878.html
>> Sent from the Apache Flex Development mailing list archive at
>>Nabble.com.
>>
>
>
>
>-- 
>
>Carlos Rovira
>Director General
>M: +34 607 22 60 05
>http://www.codeoscopic.com
>http://www.avant2.es
>
>Este mensaje se dirige exclusivamente a su destinatario y puede contener
>información privilegiada o confidencial. Si ha recibido este mensaje por
>error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
>proceda a su destrucción.
>
>De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>comunicamos
>que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
>S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>servicio o información solicitados, teniendo usted derecho de acceso,
>rectificación, cancelación y oposición de sus datos dirigiéndose a
>nuestras
>oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
>necesaria.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Peter Ent <pe...@adobe.com>.
You can use DataBindingExample for the Flex/HTML/RadioButton. I'm still
clueless as to why a browser event is being sent to the right place. The
MDLExample, while large, does isolate the RadioButtons pretty nicely. Of
course, there's lots of stuff wrapped around them which may be
contributing to what's being seen.

—peter

On 2/1/17, 11:33 AM, "Alex Harui" <ah...@adobe.com> wrote:

>Do we have a really simple test case so we don't have to wade through the
>MDLExample?
>
>-Alex
>
>On 2/1/17, 6:16 AM, "Peter Ent" <pe...@adobe.com> wrote:
>
>>I need to look into this more. My memory isn't what it used to be, so I
>>do
>>not recall how this was taking place in CreateJS (React is a very
>>different thing), but that was also before the refactor wrapping Sprite.
>>
>>The FlexJS/HTML/RadioButton JS code has no explicit event listener
>>attached to it. This is the embarrassing/mystery/memory part. When you
>>click on it, BrowserEvent appears and handles the event and pairs it up
>>with the RadioButton that was clicked. I don't know how this happens off
>>the top of my head.
>>
>>In MDL, the events seem pretty straightforward. You've added a click
>>handler and that gets called two times: once for the <input> element and
>>once for the <span> (as target). I'm not 100% sure why that happens from
>>the google point of view, but I assume that since the MDL "radio" is
>>composed of several elements, you are getting an event per element. Since
>>some of the <span> element do not have text nodes, I am guessing they do
>>not generate events.
>>
>>I will add an explicit event handler to the FlexJS/HTML/RadioButton and
>>see what happens and report back. Hopefully I'll have my memory jogged
>>enough to figure out how BrowserEvent is coming into play here. I have to
>>tell you, that having written this stuff and not remembering how it
>>works,
>>is distressing!
>>
>>‹peter
>>
>>
>>On 1/31/17, 6:32 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
>><carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
>>wrote:
>>
>>>Peter,
>>>
>>>to complement what Piotr said. MDL uses the js and css libs from google
>>>so
>>>as you click on the object I'm sure MDL handles it's own click (I assume
>>>that but didn't go low level to check it since we are creating MDL based
>>>on
>>>the structure they suggest, so with the tools they give). I think
>>>something
>>>like this should happen with CreateJS or ReactJS when you did your
>>>FlexJS
>>>integration?
>>>
>>>
>>>2017-02-01 0:06 GMT+01:00 piotrz <pi...@gmail.com>:
>>>
>>>> Peter,
>>>>
>>>> MDL RadioButton isn't get BrowserEvent. When I debugged it in the
>>>>browser
>>>> and had event listener on "label" I got two times this BrowserEvent -
>>>>I
>>>> didn't fully understand your last sentence.
>>>>
>>>> What about native FlexJS RadioButton ? How it is working when you
>>>> addEventListener ?
>>>>
>>>> Piotr
>>>>
>>>>
>>>>
>>>> -----
>>>> Apache Flex PMC
>>>> piotrzarzycki21@gmail.com
>>>> --
>>>> View this message in context: http://apache-flex-
>>>> development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-
>>>> 
>>>>Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58878.html
>>>> Sent from the Apache Flex Development mailing list archive at
>>>>Nabble.com.
>>>>
>>>
>>>
>>>
>>>-- 
>>>
>>>Carlos Rovira
>>>Director General
>>>M: +34 607 22 60 05
>>>http://www.codeoscopic.com
>>>http://www.avant2.es
>>>
>>>Este mensaje se dirige exclusivamente a su destinatario y puede contener
>>>información privilegiada o confidencial. Si ha recibido este mensaje por
>>>error, le rogamos que nos lo comunique inmediatamente por esta misma vía
>>>y
>>>proceda a su destrucción.
>>>
>>>De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>>>comunicamos
>>>que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
>>>S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>>>servicio o información solicitados, teniendo usted derecho de acceso,
>>>rectificación, cancelación y oposición de sus datos dirigiéndose a
>>>nuestras
>>>oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
>>>necesaria.
>>
>


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
Carlos,

Congratulations! I'm happy that is working now! :)

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p59037.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Alex,

Working at last! :)
that was the trick, I left the Piotr changes so we remove one HTML
dependency (RadioButtonIcon)
I was not setting up the listener you told me, and the clue was in your
last one.

COMPILE::JS
        override public function addEventListener(type:String,
handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
null):void
        {
            if (type == "click")
            {
                icon.addEventListener(type, handler, opt_capture);
            }
            else
            {
               super.addEventListener(type, handler, opt_capture,
opt_handlerScope);
            }
        }

and could remove all the dead code and do some cleaning :)

Thanks! :)



2017-02-03 18:21 GMT+01:00 Alex Harui <ah...@adobe.com>:

> I don't understand the changes you and Piotr have been making.
> -Why does RadioButtonIcon not extend EventDispatcher or UIBase?
> -Why did Piotr replace RadioButtonIcon with an HTMLInputElement?
> -Why are both of you calling the clickHandler?  It shouldn't be needed.
>
> I did not use Piotr's last change or yours.  Instead I commented out the
> one call to call clickHandler when the element dispatches a click:
>
> //element.addEventListener("click", clickHandler, false);
>
>
> Then I put in the following:
>
> override public function addEventListener(type:String, handler:Function,
> opt_capture:Boolean = false, opt_handlerScope:Object = null):void
> {
>   if (type == "click")
>     icon.element.addEventListener(type, handler, opt_capture);
>   else
>     super.addEventListener(type, handler, opt_capture, opt_handlerScope);
> }
>
> And everything appears to be working for me.  Please try it this way so I
> don't have to spend time debugging the recent changes you have made.  And
> if there is a problem, please explain as clearly as you can what the
> problem is.
>
> I'm assuming the code is setting up the DOM just like the "no-Flex"
> example I posted yesterday.  In that example, there appears to be enough
> code in the MDL JS file to make the RadioButtons function correctly
> without any FlexJS code involved.  So, in theory, all the FlexJS code
> should be doing is setting up the DOM correctly and then the getters and
> setters and event listeners should just be monitoring the DOM widgets and
> dispatching new events as needed.  I don't understand why the code in
> clickHandler should be needed at all.
>
>
> HTH,
> -Alex
>
> On 2/3/17, 12:30 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> wrote:
>
> >Hi Alex,
> >
> >for "App counter" I'm referring to the example in MDLExample or the same
> >in
> >MDLRadioButton example that I uploaded for Peter and you to check.
> >
> >I'm saying that click is working as you said, internaly to the class. I
> >don't recognize the code diff you post.
> >
> >this is the last one:
> >
> >COMPILE::JS
> >        override public function addEventListener(type:String,
> >handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
> >null):void
> >        {
> >            if (type == "click")
> >            {
> >                icon.addEventListener("click", clickHandler, false);   <--
> >this is working ok
> >            }
> >            else
> >            {
> >               super.addEventListener(type, handler);
> >            }
> >        }
> >
> >and
> >
> >COMPILE::JS
> >        public function clickHandler(event:Event):void
> >        {
> >            selected = !selected;   <-- this is called too as I click a RB
> >        }
> >
> >as I click In a radio button, I see clickHandler is called, but, in my App
> >the event is not reaching since the counter is not incremented
> >
> >I mean here one instance of RadioButton in the App is like this:
> >
> ><mdl:RadioButton groupName="g2" text="Black" click="counter7++"/>
> >
> ><js:Label text="RadioButtons throw 'click' event {counter7} times"/>
> >
> >and the label is not getting incremented.
> >
> >Hope is more clear now
> >
> >Thanks
> >
> >
> >2017-02-03 0:41 GMT+01:00 Alex Harui <ah...@adobe.com>:
> >
> >> What is the "App counter"?
> >>
> >> Without taking Piotr's or your changes and just doing the changes below,
> >> the click event counter increments as expected.
> >>
> >> -Alex
> >>
> >> diff --git
> >> a/frameworks/projects/MaterialDesignLite/src/main/
> >> flex/org/apache/flex/mdl/
> >> RadioButton.as
> >> b/frameworks/projects/MaterialDesignLite/src/main/
> >> flex/org/apache/flex/mdl/
> >> RadioButton.as
> >> index 0366013..001c587 100644
> >> ---
> >> a/frameworks/projects/MaterialDesignLite/src/main/
> >> flex/org/apache/flex/mdl/
> >> RadioButton.as
> >> +++
> >> b/frameworks/projects/MaterialDesignLite/src/main/
> >> flex/org/apache/flex/mdl/
> >> RadioButton.as
> >> @@ -321,7 +321,7 @@ package org.apache.flex.mdl
> >>              (icon.element as WrappedHTMLElement).flexjs_wrapper =
> this;
> >>              (radio as WrappedHTMLElement).flexjs_wrapper = this;
> >>
> >> -            element.addEventListener("click", clickHandler, false);
> >> +            //element.addEventListener("click", clickHandler, false);
> >>
> >>              return element;
> >>          };
> >> @@ -464,6 +464,15 @@ package org.apache.flex.mdl
> >>                  }
> >>              }
> >>          }
> >> +
> >> +               override public function addEventListener(type:String,
> >> handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
> >> null):void
> >> +               {
> >> +                       if (type == "click")
> >> +                               icon.element.addEventListener(type,
> >> handler, opt_capture);
> >> +                       else
> >> +                               super.addEventListener(type, handler,
> >> opt_capture, opt_handlerScope);
> >> +               }
> >> +
> >>          /**
> >>           * @param e The event object.
> >>           */
> >>
> >>
> >>
> >
> >
> >--
> >
> >Carlos Rovira
> >Director General
> >M: +34 607 22 60 05
> >http://www.codeoscopic.com
> >http://www.avant2.es
> >
> >Este mensaje se dirige exclusivamente a su destinatario y puede contener
> >información privilegiada o confidencial. Si ha recibido este mensaje por
> >error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
> >proceda a su destrucción.
> >
> >De la vigente Ley Orgánica de Protección de Datos (15/1999), le
> >comunicamos
> >que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
> >S.A. La finalidad de dicho tratamiento es facilitar la prestación del
> >servicio o información solicitados, teniendo usted derecho de acceso,
> >rectificación, cancelación y oposición de sus datos dirigiéndose a
> >nuestras
> >oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
> >necesaria.
>
>


-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.
I don't understand the changes you and Piotr have been making.
-Why does RadioButtonIcon not extend EventDispatcher or UIBase?
-Why did Piotr replace RadioButtonIcon with an HTMLInputElement?
-Why are both of you calling the clickHandler?  It shouldn't be needed.

I did not use Piotr's last change or yours.  Instead I commented out the
one call to call clickHandler when the element dispatches a click:

//element.addEventListener("click", clickHandler, false);


Then I put in the following:

override public function addEventListener(type:String, handler:Function,
opt_capture:Boolean = false, opt_handlerScope:Object = null):void
{
  if (type == "click")
    icon.element.addEventListener(type, handler, opt_capture);
  else
    super.addEventListener(type, handler, opt_capture, opt_handlerScope);
}

And everything appears to be working for me.  Please try it this way so I
don't have to spend time debugging the recent changes you have made.  And
if there is a problem, please explain as clearly as you can what the
problem is.

I'm assuming the code is setting up the DOM just like the "no-Flex"
example I posted yesterday.  In that example, there appears to be enough
code in the MDL JS file to make the RadioButtons function correctly
without any FlexJS code involved.  So, in theory, all the FlexJS code
should be doing is setting up the DOM correctly and then the getters and
setters and event listeners should just be monitoring the DOM widgets and
dispatching new events as needed.  I don't understand why the code in
clickHandler should be needed at all.


HTH,
-Alex

On 2/3/17, 12:30 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>Hi Alex,
>
>for "App counter" I'm referring to the example in MDLExample or the same
>in
>MDLRadioButton example that I uploaded for Peter and you to check.
>
>I'm saying that click is working as you said, internaly to the class. I
>don't recognize the code diff you post.
>
>this is the last one:
>
>COMPILE::JS
>        override public function addEventListener(type:String,
>handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
>null):void
>        {
>            if (type == "click")
>            {
>                icon.addEventListener("click", clickHandler, false);   <--
>this is working ok
>            }
>            else
>            {
>               super.addEventListener(type, handler);
>            }
>        }
>
>and
>
>COMPILE::JS
>        public function clickHandler(event:Event):void
>        {
>            selected = !selected;   <-- this is called too as I click a RB
>        }
>
>as I click In a radio button, I see clickHandler is called, but, in my App
>the event is not reaching since the counter is not incremented
>
>I mean here one instance of RadioButton in the App is like this:
>
><mdl:RadioButton groupName="g2" text="Black" click="counter7++"/>
>
><js:Label text="RadioButtons throw 'click' event {counter7} times"/>
>
>and the label is not getting incremented.
>
>Hope is more clear now
>
>Thanks
>
>
>2017-02-03 0:41 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>> What is the "App counter"?
>>
>> Without taking Piotr's or your changes and just doing the changes below,
>> the click event counter increments as expected.
>>
>> -Alex
>>
>> diff --git
>> a/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/
>> RadioButton.as
>> b/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/
>> RadioButton.as
>> index 0366013..001c587 100644
>> ---
>> a/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/
>> RadioButton.as
>> +++
>> b/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/
>> RadioButton.as
>> @@ -321,7 +321,7 @@ package org.apache.flex.mdl
>>              (icon.element as WrappedHTMLElement).flexjs_wrapper = this;
>>              (radio as WrappedHTMLElement).flexjs_wrapper = this;
>>
>> -            element.addEventListener("click", clickHandler, false);
>> +            //element.addEventListener("click", clickHandler, false);
>>
>>              return element;
>>          };
>> @@ -464,6 +464,15 @@ package org.apache.flex.mdl
>>                  }
>>              }
>>          }
>> +
>> +               override public function addEventListener(type:String,
>> handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
>> null):void
>> +               {
>> +                       if (type == "click")
>> +                               icon.element.addEventListener(type,
>> handler, opt_capture);
>> +                       else
>> +                               super.addEventListener(type, handler,
>> opt_capture, opt_handlerScope);
>> +               }
>> +
>>          /**
>>           * @param e The event object.
>>           */
>>
>>
>>
>
>
>-- 
>
>Carlos Rovira
>Director General
>M: +34 607 22 60 05
>http://www.codeoscopic.com
>http://www.avant2.es
>
>Este mensaje se dirige exclusivamente a su destinatario y puede contener
>información privilegiada o confidencial. Si ha recibido este mensaje por
>error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
>proceda a su destrucción.
>
>De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>comunicamos
>que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
>S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>servicio o información solicitados, teniendo usted derecho de acceso,
>rectificación, cancelación y oposición de sus datos dirigiéndose a
>nuestras
>oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
>necesaria.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Alex,

for "App counter" I'm referring to the example in MDLExample or the same in
MDLRadioButton example that I uploaded for Peter and you to check.

I'm saying that click is working as you said, internaly to the class. I
don't recognize the code diff you post.

this is the last one:

COMPILE::JS
        override public function addEventListener(type:String,
handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
null):void
        {
            if (type == "click")
            {
                icon.addEventListener("click", clickHandler, false);   <--
this is working ok
            }
            else
            {
               super.addEventListener(type, handler);
            }
        }

and

COMPILE::JS
        public function clickHandler(event:Event):void
        {
            selected = !selected;   <-- this is called too as I click a RB
        }

as I click In a radio button, I see clickHandler is called, but, in my App
the event is not reaching since the counter is not incremented

I mean here one instance of RadioButton in the App is like this:

<mdl:RadioButton groupName="g2" text="Black" click="counter7++"/>

<js:Label text="RadioButtons throw 'click' event {counter7} times"/>

and the label is not getting incremented.

Hope is more clear now

Thanks


2017-02-03 0:41 GMT+01:00 Alex Harui <ah...@adobe.com>:

> What is the "App counter"?
>
> Without taking Piotr's or your changes and just doing the changes below,
> the click event counter increments as expected.
>
> -Alex
>
> diff --git
> a/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/
> RadioButton.as
> b/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/
> RadioButton.as
> index 0366013..001c587 100644
> ---
> a/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/
> RadioButton.as
> +++
> b/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/
> RadioButton.as
> @@ -321,7 +321,7 @@ package org.apache.flex.mdl
>              (icon.element as WrappedHTMLElement).flexjs_wrapper = this;
>              (radio as WrappedHTMLElement).flexjs_wrapper = this;
>
> -            element.addEventListener("click", clickHandler, false);
> +            //element.addEventListener("click", clickHandler, false);
>
>              return element;
>          };
> @@ -464,6 +464,15 @@ package org.apache.flex.mdl
>                  }
>              }
>          }
> +
> +               override public function addEventListener(type:String,
> handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
> null):void
> +               {
> +                       if (type == "click")
> +                               icon.element.addEventListener(type,
> handler, opt_capture);
> +                       else
> +                               super.addEventListener(type, handler,
> opt_capture, opt_handlerScope);
> +               }
> +
>          /**
>           * @param e The event object.
>           */
>
>
>


-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.
What is the "App counter"?

Without taking Piotr's or your changes and just doing the changes below,
the click event counter increments as expected.

-Alex

diff --git 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/
RadioButton.as 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/
RadioButton.as
index 0366013..001c587 100644
--- 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/
RadioButton.as
+++ 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/
RadioButton.as
@@ -321,7 +321,7 @@ package org.apache.flex.mdl
             (icon.element as WrappedHTMLElement).flexjs_wrapper = this;
             (radio as WrappedHTMLElement).flexjs_wrapper = this;
 
-            element.addEventListener("click", clickHandler, false);
+            //element.addEventListener("click", clickHandler, false);
             
             return element;
         };
@@ -464,6 +464,15 @@ package org.apache.flex.mdl
                 }
             }
         }
+		
+		override public function addEventListener(type:String,
handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object =
null):void
+		{
+			if (type == "click")
+				icon.element.addEventListener(type, handler, opt_capture);
+			else
+				super.addEventListener(type, handler, opt_capture, opt_handlerScope);
+		}
+		
         /**
          * @param e The event object.
          */



Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi,

I think we're close. I implemented Alex suggestion. And works at level
component.
Now the problem is that in App counter is not updating, so click dead in
component.
Alex, could you take a final look?

thanks for your help!

Carlos



2017-02-02 23:27 GMT+01:00 piotrz <pi...@gmail.com>:

> Well having inside component handler I think we wanted to have property
> "selected" and give user possibility to use binding in that case.
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-
> Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58990.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Carlos Rovira <ca...@apache.org>.
Hi Peter,

we are *wrapping* what MDL does, so we have click and touch already, for
that reason I decided not complicate the overall architecture more, since I
think nobody will use it. In MDL we only will have only one style: Material
Design with the underlying rules.

This is very different to our FlexJS set where our AS3 code is what creates
the JS and the SWF. In our set we are responsible to make that organization
and separation, and I expect to have the possibility to get some theme
infrastructure so we can create themes following some specs to change skins.


2017-02-03 16:02 GMT+01:00 Peter Ent <pe...@adobe.com>:

> Do you think we should make more use of the MVC pattern in the component
> architecture? We have hard-coded these components to listen for "click"
> events.
>
> Isn't MDL the theme used on both browsers and Android apps? I might have
> that confused, not being an Android user. But at some point touch events
> will be more of the norm than "click" events, and having replaceable event
> controllers would make this easier.
>
> I know moving event handling into controllers will not solve this issue,
> but this seems like a good place to consider it. Maybe for a 1.1 release?
>
>

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Peter Ent <pe...@adobe.com>.
Do you think we should make more use of the MVC pattern in the component
architecture? We have hard-coded these components to listen for "click"
events.

Isn't MDL the theme used on both browsers and Android apps? I might have
that confused, not being an Android user. But at some point touch events
will be more of the norm than "click" events, and having replaceable event
controllers would make this easier.

I know moving event handling into controllers will not solve this issue,
but this seems like a good place to consider it. Maybe for a 1.1 release?

‹peter

On 2/2/17, 5:27 PM, "piotrz" <pi...@gmail.com> wrote:

>Well having inside component handler I think we wanted to have property
>"selected" and give user possibility to use binding in that case.
> 
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-At
>t-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58990.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
Well having inside component handler I think we wanted to have property
"selected" and give user possibility to use binding in that case. 
 
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58990.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.
Maybe I don't understand the scenario.  In your last commit I see:

+
+            label.addEventListener("click", clickHandler, false);



That looks like you are attaching a handler to the Label.  But either way,
I would expect that there wouldn’t be any addEventListener calls to listen
to click in the component code.  The customer would call addEventListener
in order to listen for "click".

What am I missing?
-Alex

On 2/2/17, 1:43 PM, "piotrz" <pi...@gmail.com> wrote:

>Alex,
>
>I did try you idea but it doesn't work. Once I'm add to input event
>listener
>"clickHandler" working but RadioButton wasn't seleted at all.
>
>Just commited small changes. Take a look yourself.
>
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-At
>t-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58984.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
Alex,

I did try you idea but it doesn't work. Once I'm add to input event listener
"clickHandler" working but RadioButton wasn't seleted at all. 

Just commited small changes. Take a look yourself.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58984.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
Carlos,

Did you try set breakpoint in the generated javascript code ? You will see
the stacktrace - There are WebBrowserEvent-s. Basically if you do not have
any eventlistener in RadioButton, you will still get "click" event if you
make 

<RadioButton click="myHandler(event)"/>

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58972.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Piotr,

what scare to me is that I remove all click code and I get clicks. Even
thought that browser was making some caching, but that wasn't the case.
I went all hierarchy up to look for some click events and didn't found
nothing.
So, if you remove all code and doesn't get clicks your a step ahead from me.


2017-02-02 12:40 GMT+01:00 piotrz <pi...@gmail.com>:

> Hi Carlos,
>
> Not exactly. If Alex's approach work we shouldn't need preventDefault. In
> the morning I did same as you, but "clickHandler" wasn't called for me -
> not
> sure why, but click inself on RadioButton works properly, but without
> selection.
>
> I've tried this solution in CheckBox and behavior was same - click was
> working fine but CheckBox didn't wasn't selected.
>
> I will investigate it more maybe later today and describe whole flow more.
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-
> Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58970.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
Hi Carlos,

Not exactly. If Alex's approach work we shouldn't need preventDefault. In
the morning I did same as you, but "clickHandler" wasn't called for me - not
sure why, but click inself on RadioButton works properly, but without
selection.

I've tried this solution in CheckBox and behavior was same - click was
working fine but CheckBox didn't wasn't selected.

I will investigate it more maybe later today and describe whole flow more.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58970.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Peter Ent <pe...@adobe.com>.
I should have responded sooner. This is fine. I can work with it.
‹peter

On 2/1/17, 1:57 PM, "piotrz" <pi...@gmail.com> wrote:

>Alex,
>
>You need to go to the MDL RadioButton and comment line where we are adding
>event listener for click - It should be enough.
>
>Let me know.
>
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-At
>t-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58933.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.

On 2/2/17, 3:28 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:

>HI Alex and Peter for taking the time to see this
>
>2017-02-02 7:15 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>> I think I correctly built a no-Flex HTML&JS test of RadioButtons:
>>
>> http://home.apache.org/~aharui/Test/MDLRadioButtons.html
>>
>> You can View Source on it to see if I did it right.
>>
>>
>The source seems right to me
>
>
>> I found out that if I listen to the outer Label, then I get two click
>> events.  But if I listen to the inner Input, which this example does,
>>then
>> I only get one click event.  So one possible workaround is to override
>> addEventListener and listen to the Input for "click".
>>
>>
>I tried that but in our case doesn't work, but don't know why
>
>In our case the input radio is "icon.element" and we should change
>to "icon.element.addEventListener("click", clickHandler, false);" right?

I don't think so.  If element is the outer Label you haven't changed where
you are listening.  IMO you would override addEventListener to find the
Label's internal Input.  There shouldn't be any use of preventDefault or
stopPropagation.  Something like:

Override public function addEventListener(type:String, handler:Function)
{
  If (type == "click")
    Input.addEventListener(type, handler);
  Else
    Super.addEventListener(type, handler);
}

If that doesn't work for you I will try it myself later.

-Alex


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Carlos Rovira <ca...@apache.org>.
HI Alex and Peter for taking the time to see this

2017-02-02 7:15 GMT+01:00 Alex Harui <ah...@adobe.com>:

> I think I correctly built a no-Flex HTML&JS test of RadioButtons:
>
> http://home.apache.org/~aharui/Test/MDLRadioButtons.html
>
> You can View Source on it to see if I did it right.
>
>
The source seems right to me


> I found out that if I listen to the outer Label, then I get two click
> events.  But if I listen to the inner Input, which this example does, then
> I only get one click event.  So one possible workaround is to override
> addEventListener and listen to the Input for "click".
>
>
I tried that but in our case doesn't work, but don't know why

In our case the input radio is "icon.element" and we should change
to "icon.element.addEventListener("click", clickHandler, false);" right?

and handler could be:

COMPILE::JS
        public function clickHandler(event:Event):void
        {
            event.preventDefault();
            selected = !selected;

        }

right?

But this doesn't work and the click is still throwing and incrementing the
counter two times

But, If I remove clickhandler completely, still the same counter goes 0, 2,
4...

Alex, could you try it yourself? maybe I'm missing something

So this is really weird! :?



-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.
Also, apparently this is a known behavior when Input is a child of Label

http://stackoverflow.com/questions/17185265/jquery-click-event-triggers-twi
ce-when-clicked-on-html-label

HTH,
-Alex

On 2/1/17, 10:15 PM, "Alex Harui" <ah...@adobe.com> wrote:

>I think I correctly built a no-Flex HTML&JS test of RadioButtons:
>
>http://home.apache.org/~aharui/Test/MDLRadioButtons.html
>
>You can View Source on it to see if I did it right.
>
>I found out that if I listen to the outer Label, then I get two click
>events.  But if I listen to the inner Input, which this example does, then
>I only get one click event.  So one possible workaround is to override
>addEventListener and listen to the Input for "click".
>
>Thoughts?
>-Alex
>
>On 2/1/17, 1:18 PM, "piotrz" <pi...@gmail.com> wrote:
>
>>In other words in case of MDL we will have to live with this issue and my
>>workaround fix. 
>>
>>Additional thing is that selected property won't work anymore, cause my
>>fix
>>is manual selecte/deselect element, but process of deselecting has been
>>done
>>without using selected.
>>
>>Carlos if we in somehow will have an array of RadioButton belonged to the
>>same group, selected property could be used for data binding - In other
>>case
>>we should remove Binding from it.
>>
>>Piotr
>>
>>
>>
>>-----
>>Apache Flex PMC
>>piotrzarzycki21@gmail.com
>>--
>>View this message in context:
>>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-A
>>t
>>t-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58941.html
>>Sent from the Apache Flex Development mailing list archive at Nabble.com.
>


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.
I think I correctly built a no-Flex HTML&JS test of RadioButtons:

http://home.apache.org/~aharui/Test/MDLRadioButtons.html

You can View Source on it to see if I did it right.

I found out that if I listen to the outer Label, then I get two click
events.  But if I listen to the inner Input, which this example does, then
I only get one click event.  So one possible workaround is to override
addEventListener and listen to the Input for "click".

Thoughts?
-Alex

On 2/1/17, 1:18 PM, "piotrz" <pi...@gmail.com> wrote:

>In other words in case of MDL we will have to live with this issue and my
>workaround fix. 
>
>Additional thing is that selected property won't work anymore, cause my
>fix
>is manual selecte/deselect element, but process of deselecting has been
>done
>without using selected.
>
>Carlos if we in somehow will have an array of RadioButton belonged to the
>same group, selected property could be used for data binding - In other
>case
>we should remove Binding from it.
>
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-At
>t-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58941.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
In other words in case of MDL we will have to live with this issue and my
workaround fix. 

Additional thing is that selected property won't work anymore, cause my fix
is manual selecte/deselect element, but process of deselecting has been done
without using selected. 

Carlos if we in somehow will have an array of RadioButton belonged to the
same group, selected property could be used for data binding - In other case
we should remove Binding from it.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58941.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Peter Ent <pe...@adobe.com>.
The event being received by the MDL RadioButton looks to me like a real
browser event; not a google'd event, not a FlexJS event, but a real
browser event. And there are two of them coming in, one with target <span>
and the other with target <input>. My guess is that MDL additional
material.min.js must be adding extra stuff somehow to this.

If you could make a pure MDL example, without any FlexJS, just an
out-of-the-box MDL with some radio buttons in it, I think you will also
get two events. I don't see why you would not unless how you form an MDL
radio button is different than the way it has been formed in the
ActionScript code of mdl.RadioButton.

‹peter

On 2/1/17, 1:57 PM, "piotrz" <pi...@gmail.com> wrote:

>Alex,
>
>You need to go to the MDL RadioButton and comment line where we are adding
>event listener for click - It should be enough.
>
>Let me know.
>
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-At
>t-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58933.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
Alex,

You need to go to the MDL RadioButton and comment line where we are adding
event listener for click - It should be enough.

Let me know.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58933.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.
What do we have to do to undo the fix and see the undesirable behavior?

On 2/1/17, 10:43 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>Hi,
>
>I create a "mdl-radiobutton" branch with a project with minimal example.
>Hope this helps to see what's going on.
>notice that the Piotr fix is in place so is working ok, but the objective
>is to understand whats happening behind the lights and try to get a less
>"hacky" solution
>
>Thanks!
>
>
>
>2017-02-01 18:21 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>>
>>
>> On 2/1/17, 8:35 AM, "piotrz" <pi...@gmail.com> wrote:
>>
>> >Currently no, but I can add one RadioButton in one of the tab in
>> >MDLExample.
>> >You will have clear example. I will need to remove my fix for this case
>> >temporary. - Let me know whether it can be in that way.
>>
>> I want an even simpler test case.  MDLExample is big.  There could be
>> something about the tabs messing up the radio button events.  Please
>>make
>> a simple test case and make sure it has the same problem.
>>
>> Thanks,
>> -Alex
>>
>>
>
>
>-- 
>
>Carlos Rovira
>Director General
>M: +34 607 22 60 05
>http://www.codeoscopic.com
>http://www.avant2.es
>
>Este mensaje se dirige exclusivamente a su destinatario y puede contener
>información privilegiada o confidencial. Si ha recibido este mensaje por
>error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
>proceda a su destrucción.
>
>De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>comunicamos
>que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
>S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>servicio o información solicitados, teniendo usted derecho de acceso,
>rectificación, cancelación y oposición de sus datos dirigiéndose a
>nuestras
>oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
>necesaria.


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi,

I create a "mdl-radiobutton" branch with a project with minimal example.
Hope this helps to see what's going on.
notice that the Piotr fix is in place so is working ok, but the objective
is to understand whats happening behind the lights and try to get a less
"hacky" solution

Thanks!



2017-02-01 18:21 GMT+01:00 Alex Harui <ah...@adobe.com>:

>
>
> On 2/1/17, 8:35 AM, "piotrz" <pi...@gmail.com> wrote:
>
> >Currently no, but I can add one RadioButton in one of the tab in
> >MDLExample.
> >You will have clear example. I will need to remove my fix for this case
> >temporary. - Let me know whether it can be in that way.
>
> I want an even simpler test case.  MDLExample is big.  There could be
> something about the tabs messing up the radio button events.  Please make
> a simple test case and make sure it has the same problem.
>
> Thanks,
> -Alex
>
>


-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.

On 2/1/17, 8:35 AM, "piotrz" <pi...@gmail.com> wrote:

>Currently no, but I can add one RadioButton in one of the tab in
>MDLExample.
>You will have clear example. I will need to remove my fix for this case
>temporary. - Let me know whether it can be in that way.

I want an even simpler test case.  MDLExample is big.  There could be
something about the tabs messing up the radio button events.  Please make
a simple test case and make sure it has the same problem.

Thanks,
-Alex


Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by piotrz <pi...@gmail.com>.
Currently no, but I can add one RadioButton in one of the tab in MDLExample.
You will have clear example. I will need to remove my fix for this case
temporary. - Let me know whether it can be in that way.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58922.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)

Posted by Alex Harui <ah...@adobe.com>.
Do we have a really simple test case so we don't have to wade through the
MDLExample?

-Alex

On 2/1/17, 6:16 AM, "Peter Ent" <pe...@adobe.com> wrote:

>I need to look into this more. My memory isn't what it used to be, so I do
>not recall how this was taking place in CreateJS (React is a very
>different thing), but that was also before the refactor wrapping Sprite.
>
>The FlexJS/HTML/RadioButton JS code has no explicit event listener
>attached to it. This is the embarrassing/mystery/memory part. When you
>click on it, BrowserEvent appears and handles the event and pairs it up
>with the RadioButton that was clicked. I don't know how this happens off
>the top of my head.
>
>In MDL, the events seem pretty straightforward. You've added a click
>handler and that gets called two times: once for the <input> element and
>once for the <span> (as target). I'm not 100% sure why that happens from
>the google point of view, but I assume that since the MDL "radio" is
>composed of several elements, you are getting an event per element. Since
>some of the <span> element do not have text nodes, I am guessing they do
>not generate events.
>
>I will add an explicit event handler to the FlexJS/HTML/RadioButton and
>see what happens and report back. Hopefully I'll have my memory jogged
>enough to figure out how BrowserEvent is coming into play here. I have to
>tell you, that having written this stuff and not remembering how it works,
>is distressing!
>
>‹peter
>
>
>On 1/31/17, 6:32 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
><carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
>wrote:
>
>>Peter,
>>
>>to complement what Piotr said. MDL uses the js and css libs from google
>>so
>>as you click on the object I'm sure MDL handles it's own click (I assume
>>that but didn't go low level to check it since we are creating MDL based
>>on
>>the structure they suggest, so with the tools they give). I think
>>something
>>like this should happen with CreateJS or ReactJS when you did your FlexJS
>>integration?
>>
>>
>>2017-02-01 0:06 GMT+01:00 piotrz <pi...@gmail.com>:
>>
>>> Peter,
>>>
>>> MDL RadioButton isn't get BrowserEvent. When I debugged it in the
>>>browser
>>> and had event listener on "label" I got two times this BrowserEvent - I
>>> didn't fully understand your last sentence.
>>>
>>> What about native FlexJS RadioButton ? How it is working when you
>>> addEventListener ?
>>>
>>> Piotr
>>>
>>>
>>>
>>> -----
>>> Apache Flex PMC
>>> piotrzarzycki21@gmail.com
>>> --
>>> View this message in context: http://apache-flex-
>>> development.2333347.n4.nabble.com/FlexJS-Click-Event-Att-
>>> Alex-and-Peter-was-Re-FlexJS-RadioButton-click-event-tp58835p58878.html
>>> Sent from the Apache Flex Development mailing list archive at
>>>Nabble.com.
>>>
>>
>>
>>
>>-- 
>>
>>Carlos Rovira
>>Director General
>>M: +34 607 22 60 05
>>http://www.codeoscopic.com
>>http://www.avant2.es
>>
>>Este mensaje se dirige exclusivamente a su destinatario y puede contener
>>información privilegiada o confidencial. Si ha recibido este mensaje por
>>error, le rogamos que nos lo comunique inmediatamente por esta misma vía
>>y
>>proceda a su destrucción.
>>
>>De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>>comunicamos
>>que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
>>S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>>servicio o información solicitados, teniendo usted derecho de acceso,
>>rectificación, cancelación y oposición de sus datos dirigiéndose a
>>nuestras
>>oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
>>necesaria.
>