Select to view content in your preferred language

API for Flex 2.0 "Switching Basemaps" small fix

635
2
07-09-2010 09:52 AM
MattWilliams
Emerging Contributor
In reference to the "Switching Basemaps" sample in the API for Flex 2.0

Since the buttons for changing basemaps are done using an <s:ButtonBar>, instead of a <mx:ToggleButtonBar> the user can reclick the selected button causing the basemap to disappear. Essentially, no basemap is selected. I tried a variety of fixes to this, but it seems to be more effort than its worth (not to mention I'm not much of a programmer). Maybe there's an easy solution, but I would recommend switching back to the ToggleButtonBar.

I'm definitely curious to see how to fix this and still use the buttonbar.
Tags (2)
0 Kudos
2 Replies
DasaPaddock
Esri Regular Contributor
You can set: requireSelection="true"

e.g.

    <s:ButtonBar id="bb"
                 right="5" top="5"
                 requireSelection="true">
        <s:dataProvider>
            <s:ArrayList>
                <fx:String>Streets</fx:String>
                <fx:String>U.S. Topo</fx:String>
                <fx:String>Imagery</fx:String>
            </s:ArrayList>
        </s:dataProvider>
    </s:ButtonBar>


Reference:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/supportClasses/L...
0 Kudos
MattWilliams
Emerging Contributor
Sweet. Thanks for the solution.
0 Kudos