This is a post for reference about the error I’m getting from Flash Builder 4 beta 2, sometimes when you are working with Flash Catalyst and Flash Builder you might need to recompose some part of your code and this is because from Catalyst you are not allowed to change any part of it.

This is where errors begin. In Flash Builder Virtualization means a component can add/remove more components inside of it, however some components need other components in order to correctly work, for example a List component and a datagrid must have an instance of a scrollBar class inside of it, this allows the component to create and increase the component when needed. But if you created a List component from Flash Catalyst and you didn´t add an instance of scrollbar or even if you delete the instance in Flash Builder, then you will get that error “BasicLayout doesn’t support virtualization” which basically means (as far as I understand it) -the component can’t create its own scrollBar, try adding an instance or class which extends it-. As an example let’s read the following code:

<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt">
<fx:Metadata>[HostComponent("spark.components.List")]</fx:Metadata>
<s:states>
<s:State name=”normal”/>
<s:State name=”disabled”/>
</s:states>
<s:DataGroup itemRenderer=”components.mtooPost” id=”dataGroup” top=”0″ bottom=”0″ right=”30″ left=”0″ clipAndEnableScrolling=”true”>
<s:layout>
<s:VerticalLayout/>
</s:layout>
</s:DataGroup>

<– NO SCROLL BAR–>
<s:transitions>
<s:Transition fromState="normal" toState="disabled" autoReverse="true">
<s:Parallel>
<s:Parallel target="{dataGroup}">
<s:Resize duration="0"/>
</s:Parallel>
</s:Parallel>
</s:Transition>
</s:transitions>
</s:Skin>

The previous code fires the error, but if instead the “NO SCROLLBAR” legend you add:

<s:VScrollBar id=”vscrollbar1″ viewport=”{dataGroup}” skinClass=”components.globalScrollBar” fixedThumbSize=”true” right=”5″ y=”13″/>

You will avoid the error, look that my scrollbar has a skinClass which you can ommit and use the normal wireframe or halo skin.

Greetings!

This post has 1 comment.

  1. Evtim
    25 Dic 09 16:41

    Hi Andres,

    You should be able to create ListSkin without having to use a scrollbar. Using a scrollbar shouldn’t be a requirement.

    I just tried this example but couldn’t reproduce the error, perhaps I’m missing some files (like the itemRenderer that you’re using, I just used the default one) or specific steps to reproduce (I tried a small flex application with simple list with one item in Flash Builder). Do you see the error when you run the application, or when you switch to design view?

    If you can reduce your application source to a small example that you can share, that’d be great. You can go ahead and report the problem at the forums here http://forums.adobe.com/community/labs/gumbo/ or log a bug here https://bugs.adobe.com/flex/

    Thanks,
    -Evtim

LEAVE A RESPONSE