You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Nemi <ne...@gmail.com> on 2014/12/02 16:58:09 UTC

Custom SkinnableComponent with fixed number of elements and selection

Hello,

I am creating a custom SkinnableComponent which should have 8 fixed
positioned selectable elements. Only one can be selected.

First guess was to try List, but I am looking for more lightweight way. 
Then tried Datagroup but then can't have seletedIndex or selected state in
DataGroup's itemRenderer skin. 
Now my last option is to have 8 RadioButtons (in components skin I can set
skin for RadioButtons) and 1 RadioButtonGroup (that will dispatch selected
index) as SkinParts.

Is my last approach wrong way and is there any other more simple, better
performance approach to create this component?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Custom-SkinnableComponent-with-fixed-number-of-elements-and-selection-tp8942.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Custom SkinnableComponent with fixed number of elements and selection

Posted by Nemi <ne...@gmail.com>.
Alex Harui wrote
> On 12/2/14, 10:14 AM, "Nemi" &lt;

> neminovno@

> &gt; wrote:
> 
>>No issues, but it is used in larger component, so just want to make it
>>'better'.
>>Thanks for another option. Wouldn't ButtonBar+8*Buttons be more heavy than
>>RadioButtonGroup+8*RadioButtons?
> 
> ButtonBar could be heavier, but IIRC, it has replaceable layout baked in.
> RadioButton does not.
> 
> You may also see differences in focus management, keyboard navigation and
> accessibility/screen-reader behavior depending on which implementation you
> go with.
> 
> -Alex

No need for focus and keyboard navigation. As I see, yes, ButtonBar has
Datagroup with layout. It looks to me it has more than I need. Basic layout
with x and y is ok for RadioButtons/Buttons. Thanks for your answers.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Custom-SkinnableComponent-with-fixed-number-of-elements-and-selection-tp8942p8953.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Custom SkinnableComponent with fixed number of elements and selection

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

On 12/2/14, 10:14 AM, "Nemi" <ne...@gmail.com> wrote:

>No issues, but it is used in larger component, so just want to make it
>'better'.
>Thanks for another option. Wouldn't ButtonBar+8*Buttons be more heavy than
>RadioButtonGroup+8*RadioButtons?

ButtonBar could be heavier, but IIRC, it has replaceable layout baked in.
RadioButton does not.

You may also see differences in focus management, keyboard navigation and
accessibility/screen-reader behavior depending on which implementation you
go with.

-Alex


Re: Custom SkinnableComponent with fixed number of elements and selection

Posted by Nemi <ne...@gmail.com>.
No issues, but it is used in larger component, so just want to make it
'better'.
Thanks for another option. Wouldn't ButtonBar+8*Buttons be more heavy than
RadioButtonGroup+8*RadioButtons?

Also, with using DocStats (https://github.com/darscan/boyblack-toolkit) got
these results:
Previous version of component(using List):
All Container Stats
Containers:             85 total
Children per container: 4 max, 1.11 avg
Depths (distance):      11 max, 7.82 avg
Unique container types: 27 total

Current working version with RadioButtons:
Containers:             56 total
Children per container: 8 max, 1.16 avg
Depths (distance):      8 max, 5.54 avg
Unique container types: 15 total

So I think I am having some positive progress here.




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Custom-SkinnableComponent-with-fixed-number-of-elements-and-selection-tp8942p8950.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Custom SkinnableComponent with fixed number of elements and selection

Posted by Alex Harui <ah...@adobe.com>.
What kind of performance/heavyweight issues are you running into?

I think another option is ButtonBar with custom layout and different
button skins.

-Alex

On 12/2/14, 7:58 AM, "Nemi" <ne...@gmail.com> wrote:

>Hello,
>
>I am creating a custom SkinnableComponent which should have 8 fixed
>positioned selectable elements. Only one can be selected.
>
>First guess was to try List, but I am looking for more lightweight way.
>Then tried Datagroup but then can't have seletedIndex or selected state in
>DataGroup's itemRenderer skin.
>Now my last option is to have 8 RadioButtons (in components skin I can set
>skin for RadioButtons) and 1 RadioButtonGroup (that will dispatch selected
>index) as SkinParts.
>
>Is my last approach wrong way and is there any other more simple, better
>performance approach to create this component?
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Custom-SkinnableComponent-w
>ith-fixed-number-of-elements-and-selection-tp8942.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.