Re: git commit: [flex-asjs] [refs/heads/develop] - Setting checked state manually now works

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: git commit: [flex-asjs] [refs/heads/develop] - Setting checked state manually now works

piotrz
Hi Harbs,

Ohh! Cool I didn't look into CheckBox in MDL and didn't know that there are
some methods "check()" :) Maybe we don't need this line either ?

input.checked = value;

Thanks,
Piotr


2017-08-18 14:01 GMT+02:00 <[hidden email]>:

> Repository: flex-asjs
> Updated Branches:
>   refs/heads/develop f208da8d9 -> 467d4bfdb
>
>
> Setting checked state manually now works
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/467d4bfd
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/467d4bfd
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/467d4bfd
>
> Branch: refs/heads/develop
> Commit: 467d4bfdba723eab442e5f8c12ddc816c7f8bb9f
> Parents: f208da8
> Author: Harbs <[hidden email]>
> Authored: Fri Aug 18 15:01:23 2017 +0300
> Committer: Harbs <[hidden email]>
> Committed: Fri Aug 18 15:01:23 2017 +0300
>
> ----------------------------------------------------------------------
>  .../main/flex/org/apache/flex/mdl/CheckBox.as   | 49 +++++++++++++++++---
>  .../src/main/resources/defaults.css             | 10 ++--
>  2 files changed, 47 insertions(+), 12 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/CheckBox.as
> ----------------------------------------------------------------------
> diff --git a/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/CheckBox.as b/frameworks/projects/
> MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
> index aeafe00..84afae8 100644
> --- a/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/CheckBox.as
> +++ b/frameworks/projects/MaterialDesignLite/src/main/
> flex/org/apache/flex/mdl/CheckBox.as
> @@ -143,7 +143,14 @@ package org.apache.flex.mdl
>           */
>                 override public function get text():String
>                 {
> -                       return IToggleButtonModel(model).text;
> +            COMPILE::SWF
> +            {
> +                       return IToggleButtonModel(model).text;
> +            }
> +            COMPILE::JS
> +            {
> +                return textNode ? textNode.nodeValue : "";
> +            }
>                 }
>
>          /**
> @@ -151,11 +158,14 @@ package org.apache.flex.mdl
>           */
>          override public function set text(value:String):void
>                 {
> -            IToggleButtonModel(model).text = value;
> +            COMPILE::SWF
> +            {
> +                IToggleButtonModel(model).text = value;
> +            }
>
>              COMPILE::JS
>                         {
> -                if(textNode == null)
> +                if(!textNode)
>                  {
>                      textNode = document.createTextNode('') as Text;
>                      checkbox.appendChild(textNode);
> @@ -175,11 +185,22 @@ package org.apache.flex.mdl
>           */
>          public function get value():String
>          {
> -            return IToggleButtonModel(model).html;
> +            COMPILE::SWF
> +            {
> +                return IToggleButtonModel(model).html;
> +            }
> +
> +            COMPILE::JS
> +            {
> +                return input.value;
> +            }
>          }
>          public function set value(newValue:String):void
>          {
> -            IToggleButtonModel(model).html = newValue;
> +            COMPILE::SWF
> +            {
> +                IToggleButtonModel(model).html = newValue;
> +            }
>
>              COMPILE::JS
>              {
> @@ -202,7 +223,14 @@ package org.apache.flex.mdl
>           */
>                 override public function get selected():Boolean
>                 {
> -                       return IToggleButtonModel(model).selected;
> +            COMPILE::SWF
> +            {
> +                       return IToggleButtonModel(model).selected;
> +            }
> +            COMPILE::JS
> +            {
> +                return input.checked;
> +            }
>                 }
>
>          /**
> @@ -210,11 +238,18 @@ package org.apache.flex.mdl
>           */
>          override public function set selected(value:Boolean):void
>          {
> -            IToggleButtonModel(model).selected = value;
> +            COMPILE::SWF
> +            {
> +                IToggleButtonModel(model).selected = value;
> +            }
>
>              COMPILE::JS
>                         {
>                  input.checked = value;
> +                if(value)
> +                    element['MaterialCheckbox'].check();
> +                else
> +                    element['MaterialCheckbox'].uncheck();
>              }
>          }
>      }
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
> resources/defaults.css
> ----------------------------------------------------------------------
> diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
> b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
> index 096f442..f8b3b05 100644
> --- a/frameworks/projects/MaterialDesignLite/src/main/
> resources/defaults.css
> +++ b/frameworks/projects/MaterialDesignLite/src/main/
> resources/defaults.css
> @@ -54,11 +54,6 @@ TextArea
>      IBeadController: ClassReference("org.apache.
> flex.html.beads.controllers.EditableTextKeyboardController");*/
>  }
>
> -CheckBox
> -{
> -    IBeadModel: ClassReference("org.apache.flex.html.beads.models.
> ToggleButtonModel");
> -}
> -
>  IconToggle
>  {
>      IBeadModel: ClassReference("org.apache.flex.html.beads.models.
> ToggleButtonModel");
> @@ -170,6 +165,11 @@ DropDownList
>
>  @media -flex-flash
>  {
> +    CheckBox
> +    {
> +        IBeadModel: ClassReference("org.apache.flex.html.beads.models.
> ToggleButtonModel");
> +    }
> +
>      Slider
>      {
>          iThumbView: ClassReference("org.apache.flex.mdl.beads.views.
> SliderThumbView");
>
>
Reply | Threaded
Open this post in threaded view
|

Re: git commit: [flex-asjs] [refs/heads/develop] - Setting checked state manually now works

Harbs
Yes. You are right. I forgot to remove that line after I added check() and uncheck().

Hmm. On second thought:

This is going to break setting the value via MXML. Let me fix that...

> On Aug 18, 2017, at 3:06 PM, Piotr Zarzycki <[hidden email]> wrote:
>
> Hi Harbs,
>
> Ohh! Cool I didn't look into CheckBox in MDL and didn't know that there are
> some methods "check()" :) Maybe we don't need this line either ?
>
> input.checked = value;
>
> Thanks,
> Piotr
>
>
> 2017-08-18 14:01 GMT+02:00 <[hidden email]>:
>
>> Repository: flex-asjs
>> Updated Branches:
>>  refs/heads/develop f208da8d9 -> 467d4bfdb
>>
>>
>> Setting checked state manually now works
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/467d4bfd
>> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/467d4bfd
>> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/467d4bfd
>>
>> Branch: refs/heads/develop
>> Commit: 467d4bfdba723eab442e5f8c12ddc816c7f8bb9f
>> Parents: f208da8
>> Author: Harbs <[hidden email]>
>> Authored: Fri Aug 18 15:01:23 2017 +0300
>> Committer: Harbs <[hidden email]>
>> Committed: Fri Aug 18 15:01:23 2017 +0300
>>
>> ----------------------------------------------------------------------
>> .../main/flex/org/apache/flex/mdl/CheckBox.as   | 49 +++++++++++++++++---
>> .../src/main/resources/defaults.css             | 10 ++--
>> 2 files changed, 47 insertions(+), 12 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
>> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/CheckBox.as
>> ----------------------------------------------------------------------
>> diff --git a/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/CheckBox.as b/frameworks/projects/
>> MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
>> index aeafe00..84afae8 100644
>> --- a/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/CheckBox.as
>> +++ b/frameworks/projects/MaterialDesignLite/src/main/
>> flex/org/apache/flex/mdl/CheckBox.as
>> @@ -143,7 +143,14 @@ package org.apache.flex.mdl
>>          */
>>                override public function get text():String
>>                {
>> -                       return IToggleButtonModel(model).text;
>> +            COMPILE::SWF
>> +            {
>> +                       return IToggleButtonModel(model).text;
>> +            }
>> +            COMPILE::JS
>> +            {
>> +                return textNode ? textNode.nodeValue : "";
>> +            }
>>                }
>>
>>         /**
>> @@ -151,11 +158,14 @@ package org.apache.flex.mdl
>>          */
>>         override public function set text(value:String):void
>>                {
>> -            IToggleButtonModel(model).text = value;
>> +            COMPILE::SWF
>> +            {
>> +                IToggleButtonModel(model).text = value;
>> +            }
>>
>>             COMPILE::JS
>>                        {
>> -                if(textNode == null)
>> +                if(!textNode)
>>                 {
>>                     textNode = document.createTextNode('') as Text;
>>                     checkbox.appendChild(textNode);
>> @@ -175,11 +185,22 @@ package org.apache.flex.mdl
>>          */
>>         public function get value():String
>>         {
>> -            return IToggleButtonModel(model).html;
>> +            COMPILE::SWF
>> +            {
>> +                return IToggleButtonModel(model).html;
>> +            }
>> +
>> +            COMPILE::JS
>> +            {
>> +                return input.value;
>> +            }
>>         }
>>         public function set value(newValue:String):void
>>         {
>> -            IToggleButtonModel(model).html = newValue;
>> +            COMPILE::SWF
>> +            {
>> +                IToggleButtonModel(model).html = newValue;
>> +            }
>>
>>             COMPILE::JS
>>             {
>> @@ -202,7 +223,14 @@ package org.apache.flex.mdl
>>          */
>>                override public function get selected():Boolean
>>                {
>> -                       return IToggleButtonModel(model).selected;
>> +            COMPILE::SWF
>> +            {
>> +                       return IToggleButtonModel(model).selected;
>> +            }
>> +            COMPILE::JS
>> +            {
>> +                return input.checked;
>> +            }
>>                }
>>
>>         /**
>> @@ -210,11 +238,18 @@ package org.apache.flex.mdl
>>          */
>>         override public function set selected(value:Boolean):void
>>         {
>> -            IToggleButtonModel(model).selected = value;
>> +            COMPILE::SWF
>> +            {
>> +                IToggleButtonModel(model).selected = value;
>> +            }
>>
>>             COMPILE::JS
>>                        {
>>                 input.checked = value;
>> +                if(value)
>> +                    element['MaterialCheckbox'].check();
>> +                else
>> +                    element['MaterialCheckbox'].uncheck();
>>             }
>>         }
>>     }
>>
>> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
>> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
>> resources/defaults.css
>> ----------------------------------------------------------------------
>> diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
>> b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
>> index 096f442..f8b3b05 100644
>> --- a/frameworks/projects/MaterialDesignLite/src/main/
>> resources/defaults.css
>> +++ b/frameworks/projects/MaterialDesignLite/src/main/
>> resources/defaults.css
>> @@ -54,11 +54,6 @@ TextArea
>>     IBeadController: ClassReference("org.apache.
>> flex.html.beads.controllers.EditableTextKeyboardController");*/
>> }
>>
>> -CheckBox
>> -{
>> -    IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>> ToggleButtonModel");
>> -}
>> -
>> IconToggle
>> {
>>     IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>> ToggleButtonModel");
>> @@ -170,6 +165,11 @@ DropDownList
>>
>> @media -flex-flash
>> {
>> +    CheckBox
>> +    {
>> +        IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>> ToggleButtonModel");
>> +    }
>> +
>>     Slider
>>     {
>>         iThumbView: ClassReference("org.apache.flex.mdl.beads.views.
>> SliderThumbView");
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: git commit: [flex-asjs] [refs/heads/develop] - Setting checked state manually now works

Harbs
My latest commit should now work whether selected is being set via MXML or by code.

> On Aug 18, 2017, at 3:29 PM, Harbs <[hidden email]> wrote:
>
> Yes. You are right. I forgot to remove that line after I added check() and uncheck().
>
> Hmm. On second thought:
>
> This is going to break setting the value via MXML. Let me fix that...
>
>> On Aug 18, 2017, at 3:06 PM, Piotr Zarzycki <[hidden email]> wrote:
>>
>> Hi Harbs,
>>
>> Ohh! Cool I didn't look into CheckBox in MDL and didn't know that there are
>> some methods "check()" :) Maybe we don't need this line either ?
>>
>> input.checked = value;
>>
>> Thanks,
>> Piotr
>>
>>
>> 2017-08-18 14:01 GMT+02:00 <[hidden email]>:
>>
>>> Repository: flex-asjs
>>> Updated Branches:
>>> refs/heads/develop f208da8d9 -> 467d4bfdb
>>>
>>>
>>> Setting checked state manually now works
>>>
>>>
>>> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/467d4bfd
>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/467d4bfd
>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/467d4bfd
>>>
>>> Branch: refs/heads/develop
>>> Commit: 467d4bfdba723eab442e5f8c12ddc816c7f8bb9f
>>> Parents: f208da8
>>> Author: Harbs <[hidden email]>
>>> Authored: Fri Aug 18 15:01:23 2017 +0300
>>> Committer: Harbs <[hidden email]>
>>> Committed: Fri Aug 18 15:01:23 2017 +0300
>>>
>>> ----------------------------------------------------------------------
>>> .../main/flex/org/apache/flex/mdl/CheckBox.as   | 49 +++++++++++++++++---
>>> .../src/main/resources/defaults.css             | 10 ++--
>>> 2 files changed, 47 insertions(+), 12 deletions(-)
>>> ----------------------------------------------------------------------
>>>
>>>
>>> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
>>> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
>>> flex/org/apache/flex/mdl/CheckBox.as
>>> ----------------------------------------------------------------------
>>> diff --git a/frameworks/projects/MaterialDesignLite/src/main/
>>> flex/org/apache/flex/mdl/CheckBox.as b/frameworks/projects/
>>> MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
>>> index aeafe00..84afae8 100644
>>> --- a/frameworks/projects/MaterialDesignLite/src/main/
>>> flex/org/apache/flex/mdl/CheckBox.as
>>> +++ b/frameworks/projects/MaterialDesignLite/src/main/
>>> flex/org/apache/flex/mdl/CheckBox.as
>>> @@ -143,7 +143,14 @@ package org.apache.flex.mdl
>>>         */
>>>               override public function get text():String
>>>               {
>>> -                       return IToggleButtonModel(model).text;
>>> +            COMPILE::SWF
>>> +            {
>>> +                       return IToggleButtonModel(model).text;
>>> +            }
>>> +            COMPILE::JS
>>> +            {
>>> +                return textNode ? textNode.nodeValue : "";
>>> +            }
>>>               }
>>>
>>>        /**
>>> @@ -151,11 +158,14 @@ package org.apache.flex.mdl
>>>         */
>>>        override public function set text(value:String):void
>>>               {
>>> -            IToggleButtonModel(model).text = value;
>>> +            COMPILE::SWF
>>> +            {
>>> +                IToggleButtonModel(model).text = value;
>>> +            }
>>>
>>>            COMPILE::JS
>>>                       {
>>> -                if(textNode == null)
>>> +                if(!textNode)
>>>                {
>>>                    textNode = document.createTextNode('') as Text;
>>>                    checkbox.appendChild(textNode);
>>> @@ -175,11 +185,22 @@ package org.apache.flex.mdl
>>>         */
>>>        public function get value():String
>>>        {
>>> -            return IToggleButtonModel(model).html;
>>> +            COMPILE::SWF
>>> +            {
>>> +                return IToggleButtonModel(model).html;
>>> +            }
>>> +
>>> +            COMPILE::JS
>>> +            {
>>> +                return input.value;
>>> +            }
>>>        }
>>>        public function set value(newValue:String):void
>>>        {
>>> -            IToggleButtonModel(model).html = newValue;
>>> +            COMPILE::SWF
>>> +            {
>>> +                IToggleButtonModel(model).html = newValue;
>>> +            }
>>>
>>>            COMPILE::JS
>>>            {
>>> @@ -202,7 +223,14 @@ package org.apache.flex.mdl
>>>         */
>>>               override public function get selected():Boolean
>>>               {
>>> -                       return IToggleButtonModel(model).selected;
>>> +            COMPILE::SWF
>>> +            {
>>> +                       return IToggleButtonModel(model).selected;
>>> +            }
>>> +            COMPILE::JS
>>> +            {
>>> +                return input.checked;
>>> +            }
>>>               }
>>>
>>>        /**
>>> @@ -210,11 +238,18 @@ package org.apache.flex.mdl
>>>         */
>>>        override public function set selected(value:Boolean):void
>>>        {
>>> -            IToggleButtonModel(model).selected = value;
>>> +            COMPILE::SWF
>>> +            {
>>> +                IToggleButtonModel(model).selected = value;
>>> +            }
>>>
>>>            COMPILE::JS
>>>                       {
>>>                input.checked = value;
>>> +                if(value)
>>> +                    element['MaterialCheckbox'].check();
>>> +                else
>>> +                    element['MaterialCheckbox'].uncheck();
>>>            }
>>>        }
>>>    }
>>>
>>> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
>>> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
>>> resources/defaults.css
>>> ----------------------------------------------------------------------
>>> diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
>>> b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
>>> index 096f442..f8b3b05 100644
>>> --- a/frameworks/projects/MaterialDesignLite/src/main/
>>> resources/defaults.css
>>> +++ b/frameworks/projects/MaterialDesignLite/src/main/
>>> resources/defaults.css
>>> @@ -54,11 +54,6 @@ TextArea
>>>    IBeadController: ClassReference("org.apache.
>>> flex.html.beads.controllers.EditableTextKeyboardController");*/
>>> }
>>>
>>> -CheckBox
>>> -{
>>> -    IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>>> ToggleButtonModel");
>>> -}
>>> -
>>> IconToggle
>>> {
>>>    IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>>> ToggleButtonModel");
>>> @@ -170,6 +165,11 @@ DropDownList
>>>
>>> @media -flex-flash
>>> {
>>> +    CheckBox
>>> +    {
>>> +        IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>>> ToggleButtonModel");
>>> +    }
>>> +
>>>    Slider
>>>    {
>>>        iThumbView: ClassReference("org.apache.flex.mdl.beads.views.
>>> SliderThumbView");
>>>
>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: git commit: [flex-asjs] [refs/heads/develop] - Setting checked state manually now works

Harbs
I fixed it a bit more and made similar changes to RadioButton.

We need to do the same for IconToggle, but I’m out of time right now. If someone can do that, it would be great.

Thanks,
Harbs

> On Aug 18, 2017, at 3:35 PM, Harbs <[hidden email]> wrote:
>
> My latest commit should now work whether selected is being set via MXML or by code.
>
>> On Aug 18, 2017, at 3:29 PM, Harbs <[hidden email]> wrote:
>>
>> Yes. You are right. I forgot to remove that line after I added check() and uncheck().
>>
>> Hmm. On second thought:
>>
>> This is going to break setting the value via MXML. Let me fix that...
>>
>>> On Aug 18, 2017, at 3:06 PM, Piotr Zarzycki <[hidden email]> wrote:
>>>
>>> Hi Harbs,
>>>
>>> Ohh! Cool I didn't look into CheckBox in MDL and didn't know that there are
>>> some methods "check()" :) Maybe we don't need this line either ?
>>>
>>> input.checked = value;
>>>
>>> Thanks,
>>> Piotr
>>>
>>>
>>> 2017-08-18 14:01 GMT+02:00 <[hidden email]>:
>>>
>>>> Repository: flex-asjs
>>>> Updated Branches:
>>>> refs/heads/develop f208da8d9 -> 467d4bfdb
>>>>
>>>>
>>>> Setting checked state manually now works
>>>>
>>>>
>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/467d4bfd
>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/467d4bfd
>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/467d4bfd
>>>>
>>>> Branch: refs/heads/develop
>>>> Commit: 467d4bfdba723eab442e5f8c12ddc816c7f8bb9f
>>>> Parents: f208da8
>>>> Author: Harbs <[hidden email]>
>>>> Authored: Fri Aug 18 15:01:23 2017 +0300
>>>> Committer: Harbs <[hidden email]>
>>>> Committed: Fri Aug 18 15:01:23 2017 +0300
>>>>
>>>> ----------------------------------------------------------------------
>>>> .../main/flex/org/apache/flex/mdl/CheckBox.as   | 49 +++++++++++++++++---
>>>> .../src/main/resources/defaults.css             | 10 ++--
>>>> 2 files changed, 47 insertions(+), 12 deletions(-)
>>>> ----------------------------------------------------------------------
>>>>
>>>>
>>>> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
>>>> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
>>>> flex/org/apache/flex/mdl/CheckBox.as
>>>> ----------------------------------------------------------------------
>>>> diff --git a/frameworks/projects/MaterialDesignLite/src/main/
>>>> flex/org/apache/flex/mdl/CheckBox.as b/frameworks/projects/
>>>> MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CheckBox.as
>>>> index aeafe00..84afae8 100644
>>>> --- a/frameworks/projects/MaterialDesignLite/src/main/
>>>> flex/org/apache/flex/mdl/CheckBox.as
>>>> +++ b/frameworks/projects/MaterialDesignLite/src/main/
>>>> flex/org/apache/flex/mdl/CheckBox.as
>>>> @@ -143,7 +143,14 @@ package org.apache.flex.mdl
>>>>        */
>>>>              override public function get text():String
>>>>              {
>>>> -                       return IToggleButtonModel(model).text;
>>>> +            COMPILE::SWF
>>>> +            {
>>>> +                       return IToggleButtonModel(model).text;
>>>> +            }
>>>> +            COMPILE::JS
>>>> +            {
>>>> +                return textNode ? textNode.nodeValue : "";
>>>> +            }
>>>>              }
>>>>
>>>>       /**
>>>> @@ -151,11 +158,14 @@ package org.apache.flex.mdl
>>>>        */
>>>>       override public function set text(value:String):void
>>>>              {
>>>> -            IToggleButtonModel(model).text = value;
>>>> +            COMPILE::SWF
>>>> +            {
>>>> +                IToggleButtonModel(model).text = value;
>>>> +            }
>>>>
>>>>           COMPILE::JS
>>>>                      {
>>>> -                if(textNode == null)
>>>> +                if(!textNode)
>>>>               {
>>>>                   textNode = document.createTextNode('') as Text;
>>>>                   checkbox.appendChild(textNode);
>>>> @@ -175,11 +185,22 @@ package org.apache.flex.mdl
>>>>        */
>>>>       public function get value():String
>>>>       {
>>>> -            return IToggleButtonModel(model).html;
>>>> +            COMPILE::SWF
>>>> +            {
>>>> +                return IToggleButtonModel(model).html;
>>>> +            }
>>>> +
>>>> +            COMPILE::JS
>>>> +            {
>>>> +                return input.value;
>>>> +            }
>>>>       }
>>>>       public function set value(newValue:String):void
>>>>       {
>>>> -            IToggleButtonModel(model).html = newValue;
>>>> +            COMPILE::SWF
>>>> +            {
>>>> +                IToggleButtonModel(model).html = newValue;
>>>> +            }
>>>>
>>>>           COMPILE::JS
>>>>           {
>>>> @@ -202,7 +223,14 @@ package org.apache.flex.mdl
>>>>        */
>>>>              override public function get selected():Boolean
>>>>              {
>>>> -                       return IToggleButtonModel(model).selected;
>>>> +            COMPILE::SWF
>>>> +            {
>>>> +                       return IToggleButtonModel(model).selected;
>>>> +            }
>>>> +            COMPILE::JS
>>>> +            {
>>>> +                return input.checked;
>>>> +            }
>>>>              }
>>>>
>>>>       /**
>>>> @@ -210,11 +238,18 @@ package org.apache.flex.mdl
>>>>        */
>>>>       override public function set selected(value:Boolean):void
>>>>       {
>>>> -            IToggleButtonModel(model).selected = value;
>>>> +            COMPILE::SWF
>>>> +            {
>>>> +                IToggleButtonModel(model).selected = value;
>>>> +            }
>>>>
>>>>           COMPILE::JS
>>>>                      {
>>>>               input.checked = value;
>>>> +                if(value)
>>>> +                    element['MaterialCheckbox'].check();
>>>> +                else
>>>> +                    element['MaterialCheckbox'].uncheck();
>>>>           }
>>>>       }
>>>>   }
>>>>
>>>> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
>>>> 467d4bfd/frameworks/projects/MaterialDesignLite/src/main/
>>>> resources/defaults.css
>>>> ----------------------------------------------------------------------
>>>> diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
>>>> b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
>>>> index 096f442..f8b3b05 100644
>>>> --- a/frameworks/projects/MaterialDesignLite/src/main/
>>>> resources/defaults.css
>>>> +++ b/frameworks/projects/MaterialDesignLite/src/main/
>>>> resources/defaults.css
>>>> @@ -54,11 +54,6 @@ TextArea
>>>>   IBeadController: ClassReference("org.apache.
>>>> flex.html.beads.controllers.EditableTextKeyboardController");*/
>>>> }
>>>>
>>>> -CheckBox
>>>> -{
>>>> -    IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>>>> ToggleButtonModel");
>>>> -}
>>>> -
>>>> IconToggle
>>>> {
>>>>   IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>>>> ToggleButtonModel");
>>>> @@ -170,6 +165,11 @@ DropDownList
>>>>
>>>> @media -flex-flash
>>>> {
>>>> +    CheckBox
>>>> +    {
>>>> +        IBeadModel: ClassReference("org.apache.flex.html.beads.models.
>>>> ToggleButtonModel");
>>>> +    }
>>>> +
>>>>   Slider
>>>>   {
>>>>       iThumbView: ClassReference("org.apache.flex.mdl.beads.views.
>>>> SliderThumbView");
>>>>
>>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: git commit: [flex-asjs] [refs/heads/develop] - Setting checked state manually now works

piotrz
Maybe we should actually create and move some things to CheckBoxView. It seems to me that there is to much happen in the main components.

Cause we should subscribe for event "mdl-componentupgraded" in MDL, take MaterialCheckbox and then eventually check that instances. - I think that should happen in View.

For now it's ok, but I may raise a jira for myself to change that.

Thanks for findings and fix! :)

Piotr
Reply | Threaded
Open this post in threaded view
|

Re: git commit: [flex-asjs] [refs/heads/develop] - Setting checked state manually now works

Harbs
Maybe, but separating view and model in MDL is kind of difficult because it’s all mixed up in MDL itself.

> On Aug 18, 2017, at 4:07 PM, piotrz <[hidden email]> wrote:
>
> Maybe we should actually create and move some things to CheckBoxView. It
> seems to me that there is to much happen in the main components.
>
> Cause we should subscribe for event "mdl-componentupgraded" in MDL, take
> MaterialCheckbox and then eventually check that instances. - I think that
> should happen in View.
>
> For now it's ok, but I may raise a jira for myself to change that.
>
> Thanks for findings and fix! :)
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> [hidden email]
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Re-git-commit-flex-asjs-refs-heads-develop-Setting-checked-state-manually-now-works-tp63906p63910.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.