LabelPlacement in spark checkbox

Hi All,
I need to place the checkbox Label to the left of the checkbox.
In Flex 3 , there is a attribute lebelPlacement which helps in acheiving it.
How can achieve it in Flex 4.5 ? i.e Spark Component.
Thanks.
Shweta

<?xml version="1.0" encoding="utf-8"?>
<!--
    ADOBE SYSTEMS INCORPORATED
    Copyright 2008 Adobe Systems Incorporated
    All Rights Reserved.
    NOTICE: Adobe permits you to use, modify, and distribute this file
    in accordance with the terms of the license agreement accompanying it.
-->
<!--- The default skin class for the Spark CheckBox component. 
      @see spark.components.CheckBox
      @langversion 3.0
      @playerversion Flash 10
      @playerversion AIR 1.5
      @productversion Flex 4
-->
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabledStates="0.5">
    <fx:Metadata>
    <![CDATA[
         * @copy spark.skins.spark.ApplicationSkin#hostComponent
        [HostComponent("spark.components.CheckBox")]
    ]]>
    </fx:Metadata>
    <fx:Script fb:purpose="styling">
        /* Define the skin elements that should not be colorized.
           For button, the graphics are colorized but the label is not. */
        static private const exclusions:Array = ["labelDisplay", "check"];
        * @private
        override public function get colorizeExclusions():Array {return exclusions;}
        /* Define the symbol fill items that should be colored by the "symbolColor" style. */
        static private const symbols:Array = ["checkMarkFill"];
        * @private
        override public function get symbolItems():Array {return symbols};
         * @private
        override protected function initializationComplete():void
            useChromeColor = true;
            super.initializationComplete();
    </fx:Script>
    <fx:Script>
        <![CDATA[
             * @private
            private static const focusExclusions:Array = ["labelDisplay"];
             * @private
            override public function get focusSkinExclusions():Array { return focusExclusions;};
        ]]>
    </fx:Script>
    <s:states>
        <s:State name="up" />
        <s:State name="over" stateGroups="overStates" />
        <s:State name="down" stateGroups="downStates" />
        <s:State name="disabled" stateGroups="disabledStates" />
        <s:State name="upAndSelected" stateGroups="selectedStates" />
        <s:State name="overAndSelected" stateGroups="overStates, selectedStates" />
        <s:State name="downAndSelected" stateGroups="downStates, selectedStates" />
        <s:State name="disabledAndSelected" stateGroups="disabledStates, selectedStates" />
    </s:states>
    <s:Group right="0" verticalCenter="0" width="13" height="13" layoutDirection="ltr">
        <!-- drop shadow -->
        <s:Rect left="-1" top="-1" right="-1" bottom="-1">
            <s:stroke>
                <s:LinearGradientStroke rotation="90" weight="1">
                    <s:GradientEntry color="0x000000"
                                   color.downStates="0xFFFFFF"
                                   alpha="0.011"
                                   alpha.downStates="0" />
                    <s:GradientEntry color="0x000000"
                                   color.downStates="0xFFFFFF"
                                   alpha="0.121"
                                   alpha.downStates="0.57" />
                </s:LinearGradientStroke>
            </s:stroke>
        </s:Rect>
        <!-- fill -->
        <s:Rect left="1" top="1" right="1" bottom="1">
            <s:fill>
                <s:LinearGradient rotation="90">
                    <s:GradientEntry color="0xFFFFFF"
                                   color.overStates="0xBBBDBD"
                                   color.downStates="0xAAAAAA"
                                   alpha="0.85" />
                    <s:GradientEntry color="0xD8D8D8"
                                   color.overStates="0x9FA0A1"
                                   color.downStates="0x929496"
                                   alpha="0.85" />
                </s:LinearGradient>
            </s:fill>
        </s:Rect>
        <!-- fill highlight -->
        <s:Rect left="1" right="1" top="1" height="5">
            <s:fill>
                <s:SolidColor color="0xFFFFFF" alpha="0.33" alpha.downStates="0" />
            </s:fill>
        </s:Rect>
        <!-- layer 6: highlight stroke (all states except down) -->
        <s:Rect left="1" right="1" top="1" bottom="1" excludeFrom="downStates">
            <s:stroke>
                <s:LinearGradientStroke rotation="90" weight="1">
                    <s:GradientEntry color="0xFFFFFF" alpha.overStates="0.33" />
                    <s:GradientEntry color="0xFFFFFF" alpha="0.12" alpha.overStates="0.0396" />
                </s:LinearGradientStroke>
            </s:stroke>
        </s:Rect>
        <!-- layer 6: highlight stroke (down state only) -->
        <s:Rect left="1" top="1" bottom="1" width="1" includeIn="downStates">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.07" />
            </s:fill>
        </s:Rect>
        <s:Rect right="1" top="1" bottom="1" width="1" includeIn="downStates">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.07" />
            </s:fill>
        </s:Rect>
        <s:Rect left="1" top="1" right="1" height="1" includeIn="downStates">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.25" />
            </s:fill>
        </s:Rect>
        <s:Rect left="1" top="2" right="1" height="1" includeIn="downStates">
            <s:fill>
                <s:SolidColor color="0x000000" alpha="0.09" />
            </s:fill>
        </s:Rect>
        <!-- border - put on top of the fill so it doesn't disappear when scale is less than 1 -->
        <s:Rect left="0" top="0" right="0" bottom="0">
            <s:stroke>
                <s:LinearGradientStroke rotation="90" weight="1">
                    <s:GradientEntry color="0x000000"
                                   alpha="0.5625"
                                   alpha.downStates="0.6375" />
                    <s:GradientEntry color="0x000000"
                                   alpha="0.75"
                                   alpha.downStates="0.85" />
                </s:LinearGradientStroke>
            </s:stroke>
        </s:Rect>
        <!-- checkmark -->
        <!--- The checkmark in the box for this skin. To create a custom check mark, create a custom skin class. -->
        <s:Path left="2" top="0" includeIn="selectedStates" id="check" itemCreationPolicy="immediate"
                data="M 9.2 0.1 L 4.05 6.55 L 3.15 5.0 L 0.05 5.0 L 4.6 9.7 L 12.05 0.1 L 9.2 0.1">       
            <s:fill>
                <!---
                    @private
                    The solid color fill for the CheckBox's checkmark. The default alpha is .9, and the default fill color is 0x000000.
                -->
                <s:SolidColor id="checkMarkFill" color="0" alpha="0.8" />
            </s:fill>
        </s:Path>
    </s:Group>
    <!-- Label -->
    <!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay -->
    <s:Label id="labelDisplay"
             textAlign="start"
             verticalAlign="middle"
             maxDisplayedLines="1"
             left="0" right="18" top="3" bottom="3" verticalCenter="2" />
</s:SparkSkin>
I changed the tickbox group to have a value of right=0
and the label to have left=0 and right=18
simples

Similar Messages

  • Is there a way to make the spark checkbox directional?

    Hi All,
    Is there a (easy) way to make the checkbox with the text on the left to the quare?
    Thanks in advance,
    Lior

    David,
    How can i make the skin change dynamically from left to right?
    i want to built a component based on the checkbox (listed below) , and change the skin according to the direction selected by the user.
    Can you please tell me what is the best way to do it?
    Lior
    ** The "DirectionalCheckbox" component
    <?xml version="1.0" encoding="utf-8"?>
    <s:CheckBox xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Script>
            <![CDATA[
                import flashx.textLayout.formats.Direction;
                private var _checkBoxDireciton:String = Direction.LTR;
                [Bindable]
                public function get checkBoxDireciton():String
                    return _checkBoxDireciton;
                public function set checkBoxDireciton(value:String):void
                    _checkBoxDireciton = value;
            ]]>
        </fx:Script>
    </s:CheckBox>

  • Spark Checkbox/Label vertical alignment

    I need to have a checkbox and a label in the same horizontal line. Implemented like this:
      <s:HGroup verticalAlign="middle" >
        <s:CheckBox label="Checkbox"  />
        <s:Label text="Label" />
      </s:HGroup>
    the checkbox and the label aren't aligned.
    How can I have them aligned correctly?

    You can do instead:
    <s:HGroup verticalAlign="middle">
        <s:CheckBox />
        <s:Label text="Checkbox" />
        <s:Label text="Label" />
    </s:HGroup>
    Regards,
    Pablo Souza

  • Errors when using Spark Buttons in dynamically loaded modules loaded by dynamically loaded modules

    Ok ... I have to admit this issue is rather special ;-)
    I have a flex application that loads a list of modules after the user logs in, depending on the permissions of the user.
    One of these modules contains a component, that allows the user to configure settings for different types of objects.
    For each object type (can be extended) there exists one module swf.
    The strange problem I am having now is that as soon as a Spark Button (or anything derived from one ... CheckBox) inside the settings-module. I get the following error (unfortunately in german ... but I'll try to translate).
    This error happens when using a spark CheckBox (Which is derived from Spark Button):
    ArgumentError: Error #2004: Einer der Parameter ist ungültig.
    at flash.display::Graphics/drawRect()
    at mx.graphics::RectangularDropShadow/drawShadow()[E:\dev\4.x\frameworks\projects\framework\ src\mx\graphics\RectangularDropShadow.as:575]
    at mx.skins.spark::BorderSkin/updateDisplayList()[E:\dev\4.x\frameworks\projects\sparkskins\ src\mx\skins\spark\BorderSkin.mxml:174]
    at mx.core::UIComponent/validateDisplayList()[E:\dev\4.x\frameworks\projects\framework\src\m x\core\UIComponent.as:8709]
    at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.x\frameworks\projects\framework \src\mx\managers\LayoutManager.as:663]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:718]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1072]
    When having a look at the problem the cause is that width and height are not set (NaN).
    If I use a plain Button I get the same error in "drawRoundRect".
    As soon as I change back to a mx-Button/Checkbox, everything is fine.
    In my current Case I wanted to use a custom TreeItemRenderer to display a CheckBox in the tree. This tree Item renderer is included in a custom Lib that is used by all modules.
    I have one Second Level module using this renderer. I have one Third Level Module thas uses the exact same tree definition. If I use the MX CheckBox I get CheckBoxes in the Second- and Third-Level Module. If I use the Spark-CheckBox I get a CheckBox in my Second Level Module and the above Error in the Third Level Module.
    To make everything even stranger: I have a custom component loading my modules and I use this in the Top Level Module to load the Second Level Modules and in my Second Level Module to load my Third Level Modules (So I would guess If my loader is broken, then the Second Level Modules should not work either).
    Help is greatly appreciated :-)
    Regards,
          Chris

    Ok, I managed to find out what was going wrong and to get my stuff working again. I have to admit that I have no idea why my application / flex was showing this behaviour. The only way I could track this down was by undoing the Subversion checkins one by one. Finding out what was happening using common sense seems to be out of the question with this issue.
    My application is built up of a main application swf that loads module swfs and a library swc that contains common stuff and is used in the main application and the modules.
    I now had some custom TreeItemRenderers in my modules. The problem was caused by moving a custom TreeItemRenderer from one module to the library-swc. I could successfully reproduce this. If I add only one class extending TreeItemRenderer to my library (I don't even have to use it), the entire flex system goes haywire. As soon as I remove that class, everything is ok. I checked, if there might be a problem with third party libs containing flex core classes which might be used instead of the sdk ones, but after looking at the catalogs of the third party swcs I couldn't find a reference to TreeItemRenderer.
    Any Ideas? I sort of dislike the idea of being able to run into such strange problems. Is there a tool that allows me to check for class compatibility issues?

  • Mouse focus in custom DataGrid ItemRenderer (re-post*)

    * I already posted this question in the "Flex" forum, but didn't get any replies. I'm not sure if this will yield any different results, but I figure it's worth a try...
    I have a custom MXDataGridItemRenderer with a custom nested Spark CheckBox component that I'm trying to use within an MXDataGrid component. The renderer works fine, as does the nested checkbox, however I'm unable to decouple the mouse events for the checkbox from the DataGrid row. I intend to use the DataGrid as a playlist for the VideoPlayer component with an FX Model-based DataProvider and the purpose of the checkbox is to allow the user to automatically play the next selected checkbox item in the list; similar to the checkboxes in iTunes. Placing an instance of the checkbox on top of DataGrid achieves the desired decoupling, but this is obviously an impractical solution, which I include only to illustrate what I'm trying to do. Any recommendations would be greatly appreciated.
    Thanks,
    ~Benny

    Work around posted here: http://forums.adobe.com/message/3160303#3160303

  • [svn:fx-4.x] 14345: Mirroring bug fixes

    Revision: 14345
    Revision: 14345
    Author:   [email protected]
    Date:     2010-02-22 15:10:45 -0800 (Mon, 22 Feb 2010)
    Log Message:
    Mirroring bug fixes
    http://bugs.adobe.com/jira/browse/SDK-25561 - MX PopUpButton displays popup inconsistently when layoutDirection is set to rtl
    http://bugs.adobe.com/jira/browse/SDK-25560 - MX ColorPicker displays popup inconsistently when layoutDirection is set to rtl
    Translate the position of the popup from the mirrored coordinates to the un-mirrored global coordinates
    http://bugs.adobe.com/jira/browse/SDK-25552 - The Spark CheckBox icon should be mirroring
    Removed setting the icon layoutDirection = ?\226?\128?\156ltr?\226?\128?\157. The icon should follow the mirroring of the component.
    http://bugs.adobe.com/jira/browse/SDK-25484 - MX Slider datatip is incorrectly positioned when layoutDirection is rtl
    Fixed two issues. The dataTip positioning is fixed by translating the position of the popup from the mirrored coordinates to the un-mirrored global coordinates. The second is fixing an issue of reversing the dataTipPosition when ?\226?\128?\156left?\226?\128?\157 or ?\226?\128?\156right?\226?\128?\157 when mirrored.
    QE notes: None
    Doc notes: None
    Bugs: SDK-25561, SDK-25560, SDK-25552, SDK-25484
    Reviewer: Hans
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-25561
        http://bugs.adobe.com/jira/browse/SDK-25560
        http://bugs.adobe.com/jira/browse/SDK-25552
        http://bugs.adobe.com/jira/browse/SDK-25484
        http://bugs.adobe.com/jira/browse/SDK-25561
        http://bugs.adobe.com/jira/browse/SDK-25560
        http://bugs.adobe.com/jira/browse/SDK-25552
        http://bugs.adobe.com/jira/browse/SDK-25484
    Modified Paths:
        flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/ColorPicker.as
        flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/PopUpButton.as
        flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider. as
        flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/skins/spark/CheckBoxSkin.mxml

  • How to handle multiple selection in the Spark List control with checkbox as itemrenderer?

    Hi All,
    I am using checkbox as an ItemRenderer in spark list.
    I have a query.
    how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
    how to retrieve the selected item label?
    Thank you in advance.

    Hi there, I'll tweak your code a little bit to something like this:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical">
        <mx:Script>
            <![CDATA[
                 import mx.events.ListEvent;
                 import mx.controls.CheckBox;
               [Bindable]
               private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
                private function onChange(e:ListEvent):void
                   if(CheckBox(e.itemRenderer).selected){
                             mySelectedIndexes.addItem(e.rowIndex);
                   }else{
                                  mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));     
                   chkList.selectedIndices=mySelectedIndexes.toArray();
            ]]>
        </mx:Script>
    <mx:ArrayCollection id="collection">
            <mx:Object label="Test A"/>
            <mx:Object label="Test B"/>
            <mx:Object label="Test C"/>
            <mx:Object label="Test D"/>
            <mx:Object label="Test E"/>
            <mx:Object label="Test F"/>
            <mx:Object label="Test G"/>
        </mx:ArrayCollection>
    <mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox"  itemClick="onChange(event);" allowMultipleSelection="true"/>
    </mx:Application>

  • How to filter a spark datagrid using a checkbox?

    Hi i want to know how can i filter a spark datagrid using  a check. I have a column by the name status on the datagrid, which can be active or inactive. When i check the checkbox i should be able to see all the records and when i uncheck it i should only be able to see all the records with the status ACTIVE...

    Then, try to add another attribute in your SELECT VO statement, which truncates the original date_and_time field:
       SELECT.... TRUNC(DATE_AND_TIME) as truncated_dateAfter that, put reference to that attribute in the filter facet, as follows
             <f:facet name="filter">
                      <af:inputDate value="#{vs.filterCriteria.TruncatedDate}" id=.../>
             </facet>Do not forget to add the TruncatedDate attribute in the <tree...> binding in the pageDef, along with others VO attributes. Do that manually.

  • Want to implent CheckBox for itemRenderer and headerItemRenderer for spark DataGrid.

    I am using mx:DataGrid in my application.
    The first column itemRenderer and headerItermRenderer is CheckBox.
    Now I want to move it to spark DataGrid. I could imprement itermRenderer easily by creating sub-claassing GridItemRenderer. But I am struck at implementing headerItermRenderer. I tried to implent it using GridItemRenderer sub-class as I did with itemRenderer. It is not working. The set data method is not getting called.
    Do anyone have code for implenting checkbox as itemRenderer and headerRendere in spark datagrid (and not mx datagrid)?
    Thanks,
    Prithvee Zankat.

    Hi,
    Item renderer can be implemented for spark and i think you will have to write custom header renderer. I am providing some useful links,please go through them :
    http://help.adobe.com/en_US/flex/using/WS0ab2a460655f2dc3-427f401412c60d04dca-7ff3.html
    http://cookbooks.adobe.com/post_3_state_checkbox_for_header_renderer_in_datagrid-18900.htm l
    http://blogs.adobe.com/aharui/category/item-renderers
    http://boardreader.com/thread/Spark_Datagrid_custom_header_renderer_1zw07Xgoeo.html
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Using checkboxes to select items in a Spark DataGroup/List?

    I have a DataGroup from Catalyst, laid out like a tile list:
    I'd like to do something a bit different, in that I'd like to allow people to multi-select items in the list using those checkboxes instead of the usual command/control-click.
    The checkbox, label and image are in the itemRenderer.  Is there an easy way that I can have that checkbox toggle the selected state of its list item?

    Hi,
    Using the checkbox as a selection is easy enough as all you have to do is add a change event to the checkbox in the renderer and then in the event
    selected=mycheckbox.selected;
    The fun is how to handle the list click event from the checkbox you can stop propagation but if the item is clicked it will reset the selected indices.
    There is a few ways to handle this
    when processing the list don't use the selected indices just use the checkbox value to determine whats selected
    disable the listbox click event so items have to be selected with the checkbox
    or the most complex lots of overriding so that click acts like a ctrl/click and the checkbox/itemclick can toggle each other.
    David

  • How to unSelect checkBoxes inside a buttonBar

    Hello!
    I've been a Flex developer for several months now and have made some great strides.  However, I've ran across a problem that requires some help from the Pros.
    I'm using Flash Builder 4.5 Premium.
    Scenerio:
    I have a buttonBar whose dataProvider is an mx:viewStack supplied by Spark NavigatorContent.  I have checkBoxes inside each of the NavigatorContent instances.  The checkBoxes turn content on and off.  Works great.
    Problem:
    When you select a different button in the buttonBar the selected content from the previuos button still displays.
    Question:
    How do I get the selected content from the previous button to not display? I'm not sure how to do this. 
    Bonus:
    If someone can tell me how to handle the checkBox eventHandler more efficiently that would be awesome!  Because right now I currently have an eventHandler function for each check box (like 18).  Since I'm still grean, so I figured I'd get everything working before trying to streamline this.  Or perhaps (I'm havina an epiphany) I need to add something to this code to unSelect the checkBox once the button has changed?  Not sure and confused. 
    Thanks for the help!
    Joe
    App Code:  If it's too much I appologize - I did leave out some.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:esri="http://www.esri.com/2008/ags"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   pageTitle="Aloha Existing Conditions"
                   initialize="initApp(event)">
        <fx:Style source="alohaExistingCond.css"/>
        <fx:Script>
            <![CDATA[
                import com.esri.ags.Graphic;
                import com.esri.ags.components.Editor;
                import com.esri.ags.components.Legend;
                import com.esri.ags.events.FeatureLayerEvent;
                import com.esri.ags.events.LayerEvent;
                import com.esri.ags.geometry.MapPoint;
                import com.esri.ags.layers.ArcGISDynamicMapServiceLayer;
                import com.esri.ags.layers.DynamicMapServiceLayer;
                import com.esri.ags.layers.TiledMapServiceLayer;
                import com.esri.ags.layers.supportClasses.LayerInfo;
                import com.esri.ags.layers.supportClasses.LayerLegendInfo;
                import com.esri.ags.layers.supportClasses.LegendItemInfo;
                import com.esri.ags.tasks.supportClasses.AddressCandidate;
                import flash.events.Event;
                import flashx.textLayout.events.UpdateCompleteEvent;
                import mx.containers.TitleWindow;
                import mx.controls.Alert;
                import mx.core.IFlexDisplayObject;
                import mx.events.FlexEvent;
                import mx.managers.PopUpManager;
                import mx.rpc.AsyncResponder;
                import spark.components.Panel;
                import spark.events.IndexChangeEvent;
                import splash1.SplashScreen1;
                public function initApp(event:FlexEvent):void
            //        showWindow();   
            //        viewMenu.addEventListener(IndexChangeEvent.CHANGING, bBarChangeHandler);
            //    public function bBarChangeHandler():void
                private var point1:Point = new Point();
                private function showWindow():void {
                    var login:SplashScreen1 = SplashScreen1(PopUpManager.createPopUp(this, SplashScreen1 , true));
                           PopUpManager.centerPopUp(login);
                public function turnonbasemap():void   
                    photo.visible = false;
                    basemap.visible = true;       
                public function turnonphoto():void
                    photo.visible = true;
                    basemap.visible = false;       
                public function bintBox(evt:MouseEvent):void
                    myLegend.visible = true;
                    if(CheckBox(evt.target).selected)
                    bikelaneMapServer.visible = true;
                else
                     bikelaneMapServer.visible = false;
                public function sintBox(evt:MouseEvent):void
                    sidewalkMapServer.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        sidewalkMapServer.visible = false;   
                public function scomBox(evt:MouseEvent):void
                    sidewalkComments.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        sidewalkComments.visible = false;   
                public function bcomBox(evt:MouseEvent):void
                    bikelaneComments.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        bikelaneComments.visible = false;   
                public function opsBox(evt:MouseEvent):void
                    OPS.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        OPS.visible = false;   
            ]]>   
        </fx:Script>
    <!-- Declaration are for Non-Visual Elements ~~~~~~~~~~~~~~~ -->
        <fx:Declarations>
            <esri:Locator id="locateTask"
                          url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer"/>
            <esri:SimpleMarkerSymbol id="mySymbol"
                                     alpha="0.5"
                                     color="0xFF0000"
                                     size="21"
                                     style="circle">
                <esri:SimpleLineSymbol width="2"/>
            </esri:SimpleMarkerSymbol>
        </fx:Declarations>
    <!-- Button Bar Window ~~~~~~~~~~~~~~~ -->
        <s:BorderContainer id="buttonBarContainer"
                           left="352" right="3" top="64" height="134"
                           borderWeight="2" cornerRadius="5">
            <s:Label text="Select an item below:"
                     x="10" y="10"/>
            <s:ButtonBar id="viewMenu" left="5" right="5" top="30" height="21"
                         dataProvider="{myViewStack}"
                         requireSelection="true"/>
                         <!-- change="changeSelection(event)" -->
                <s:Group id="layerGroup"
                         left="5" right="3" top="55" height="80">
                        <mx:ViewStack id="myViewStack" height="72">
                            <s:NavigatorContent id="planning" label="Planning">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="bCommentCheckBox" 
                                label="Bike Lane Comment"
                                fontSize="14"
                                click="bcomBox(event)"/>
                                <s:CheckBox id="foo1"
                                            label="Foo 1"
                                            fontSize="14"/>
                                <s:CheckBox id="foo2" 
                                            label="Foo 2"
                                            fontSize="14"/>
                                <s:CheckBox id="foo3"
                                            label="Foo 3"
                                            fontSize="14"/>
                                <s:CheckBox id="foo4" 
                                            label="Foo 4"
                                            fontSize="14"/>
                            </s:NavigatorContent>
    <!--  trans tab  ~~~~~~~~~~~~~~-->                   
                            <s:NavigatorContent id="trans" label="Transportation">
                                <s:layout>
                                    <s:TileLayout columnWidth="175" orientation="columns"
                                                  paddingLeft="10" paddingRight="20"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="sCommentCheckBox"
                                            label="Sidewalk Comments"
                                            fontSize="14"
                                            click="scomBox(event)"/>
                                <s:CheckBox id="sidewalkCheckBox"
                                            label="Sidewalk Inventory"
                                            fontSize="14"
                                            click="sintBox(event)"/>
                                <s:CheckBox id="bikelaneCheckBox" 
                                            label="Bike Lane Inventory"
                                            fontSize="14"
                                            click="bintBox(event)"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="environ" label="Environmental">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="200"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="opsCheckBox" 
                                            label="Watershed Enhancement"
                                            fontSize="14"
                                            click="opsBox(event)"/>
                                <s:CheckBox id="foo5"
                                            label="Foo 5"
                                            fontSize="14"/>
                                <s:CheckBox id="foo6" 
                                            label="Foo 7"
                                            fontSize="14"/>
                                <s:CheckBox id="foo8"
                                            label="Foo 8"
                                            fontSize="14"/>
                                <s:CheckBox id="foo9" 
                                            label="Foo 9"
                                            fontSize="14"/>
                                <s:CheckBox id="foo10"
                                            label="Foo 10"
                                            fontSize="14"/>
                                <s:CheckBox id="foo11" 
                                            label="Foo 11"
                                            fontSize="14"/>
                                <s:CheckBox id="foo12"
                                            label="Foo 12"
                                            fontSize="14"/>
                                <s:CheckBox id="foo13" 
                                            label="Foo 13"
                                            fontSize="14"/>
                                <s:CheckBox id="foo14" 
                                            label="Foo 14"
                                            fontSize="14"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="housing" label="Housing/Social">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Housing and Social Services Maps"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="built" label="Built Environment">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Built Environment Maps"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="transit" label="Transit">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Tansit Maps"/>
                            </s:NavigatorContent>
                        </mx:ViewStack>
                    <!--<s:Label id="selectionText"
                             x="10" y="60"/>  -->
                </s:Group>
        </s:BorderContainer>
    <!-- Legend Window ~~~~~~~~~~~~~~~ -->   
        <s:BorderContainer id="leContainer" left="3" top="140" bottom="3" width="347"
                           borderColor="#808080" borderWeight="2" cornerRadius="5" fontWeight="bold">
            <s:VGroup id="hGroup"
                      width="333"
                      height="500"
                      paddingBottom="11"
                      paddingLeft="5"
                      paddingRight="5"
                      paddingTop="10">
                <esri:Legend id="myLegend"
                             height="100%"
                             bottom="10"
                             width="330"
                             layers="{[ bikelaneMapServer, sidewalkMapServer, sidewalkComments, bikelaneComments, OPS ]}"
                             map="{myMap}"
                             respectCurrentMapScale="true"/>                 
            </s:VGroup>   
        </s:BorderContainer>   
    <!-- Map Window ~~~~~~~~~~~~~~~ -->       
        <s:BorderContainer id="mapBorder"
                           left="352" right="3" top="200" bottom="3"
                           borderColor="#808080"
                           borderWeight="2" cornerRadius="5">
            <esri:Map id="myMap" left="0" right="0" top="0" bottom="0" wrapAround180="true" logoVisible="false">
                <esri:extent>
                    <esri:Extent id="washco"
                                 xmin="7565269.4485383" ymin="657281.31999349" xmax="7607044.62214942" ymax="696603.368604601">   
                        <esri:SpatialReference wkid="2269"/>       
                    </esri:Extent>   
                </esri:extent>
                <esri:ArcGISTiledMapServiceLayer id="basemap"
                                                 url="http://......../Washco_primary_basemap_SP/MapServer"/>
                <esri:ArcGISTiledMapServiceLayer id="photo"
                                                 url="http://......../Orthos_2010_SP/MapServer"
                                                 visible="false"/>
                <esri:ArcGISDynamicMapServiceLayer id="bikelaneMapServer"
                                                   name=" "
                                                   visible="false"
                                                   url="http://........DOE_Bikelane/MapServer"/>
                <esri:ArcGISDynamicMapServiceLayer id="sidewalkMapServer"
                                                   name=" "
                                                   visible="false"
                                                   url="http://......../DOE_Sidewalk/MapServer"/>
                <esri:ArcGISDynamicMapServiceLayer id="OPS"
                                                   name=" "
                                                   visible="false"
                                                   url="http://........Watershed_Enhance/MapServer"/>   
                <esri:FeatureLayer id="sidewalkComments"
                                   mode="snapshot"
                                   visible="false"
                                   url="http://........./SidewalkComment/FeatureServer/0"/>
                <!--
                outFields="[Comment, entered]"
                -->
                <esri:FeatureLayer id="bikelaneComments"
                                   mode="snapshot"
                                   visible="false"
                                   url="http://......../FeatureServer/0"/>
                <!--
                outFields="[Comment, entered]"
                -->
                <esri:GraphicsLayer id="myGraphicsLayer"/>
            </esri:Map>
    </s:Application>

    Hi Kiran,
    U can use ItemRenderer to show button inside a cell of datagrid..!
    either inline ItemRenderer or external ItemRenderer as per your conveninent.
    sample:
    <mx:DataGrid>
    <mx:DataGridColumn headerText="Title" dataField="title">
                <mx:itemRenderer>
                    <mx:Component>
                            <mx:Button lable="Add" width="50" height="50"/>
                    </mx:Component>
                </mx:itemRenderer>
            </mx:DataGridColumn>
    </mx:DataGrid>
    Go Through this link : http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html
    Thanks,
    Pradeep

  • How to create spark skins using fxg vector graphics&how to switch b/w spark skins at runtime/via XML

    Hi,
    I want to create a number of Spark Skins using some vector images that I have with me. I can obtain the vector images in FXG format-- but what I am looking for is some way to quickly create multiple skins for various UI elements like buttons, menus, radio button, checkboxes, etc -- not by converting the fxg->mxml but by using fxg files directly (after including them in the skins project in Flash Builder 4.6). Since I want to create many such skins (atleast 8-10) what is the fastest way of accomplishing this?
    Also, once I create multiple Spark Skins, how do I switch from one skin to another, in a running app? -- something like a template switcher, where the user viewing the flex app chooses a color, and the spark skin is immediately changed to the skin of that color (I would have already created the skin...). And can I store this skin template value in an XML? So that the end user can simply change this param in XML to change the design of the flex app?
    Arvind.

    Follow-up:
    Out of pure wishful thinking I decided I would just see what happened if I pretended 'exportFXG' was already a part of JSFL. Based on the signature of 'exportPNG', i tried the following lines:
      var success = fl.getDocumentDOM().exportFXG("file:///C:/mySymbol.fxg"); 
      fl.trace("success:"+success); // output: success:true 
    It worked! Fantastic! I'm not sure if exportFXG is considered still in "beta" and therefore intentionally excluded from the docs, or if it was just an oversight. But at least it gives us something to experiment with.

  • How to set selected text color in Spark TextInput

    I'm trying to make Spark TextInputs and MXFTETextInputs look like Halo/MX TextInputs as much as possible, since I have a mix of both Spark and MX TextInputs in my application. I know I can set the
    selection background color to black using focusedTextSelectionColor. How can I set the selected text color to white so it matches the MX white-on-black look?

    This works, if you set the enabled property directly on the s:TextInput:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <s:layout>
            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
        </s:layout>
        <s:controlBarContent>
            <s:CheckBox id="ch" label="enabled" selected="true" />
        </s:controlBarContent>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            s|TextInput:disabled {
                color: red;
        </fx:Style>
        <s:Group>
            <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{ch.selected}" />
        </s:Group>
    </s:Application>
    It can get a bit trickier when you're setting the enabled property on a parent container, since (I believe) that the child control's enabled properties are still set to true and just the container is disabled. One possible workaround would be to bind the child TextInput control's enabled property to the container's enabled property. That way the s:TextInput should still go to it's disabled state and you can customize the disabled state's styles to have darker text, or whatever else you want.
    <s:Group id="gr" enabled="{ch.selected}">
        <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{gr.enabled}" />
    </s:Group>
    Peter

  • How to set a checkbox in a datagrid's itemrenderer

    Hello.
    I've a spark datagrid. In a column there is a checkbox. In another column (I need to add it dynamically with actionscript) I've another checkbox (inside an itemrenderer). Cliccking on the first checkbox, I need to enable/disable the second checkbox.
    More in general I need to interact not just with a checkbox but some other components inside columns added dynamically.
    My question is: how to get (with actionscript) components inside an itemrender created dynamically?
    Follow details related to the checkbox case:
    Here my spark datagrid columns definitions:
    <s:columns>
                        <s:ArrayList>
                                  <s:GridColumn headerText="Azioni" resizable="false" sortable="false" width="49" ....../>
                                  <s:GridColumn headerText="Iscritto" width="60" itemRenderer="renderers.EventoPersonaCheckBoxRenderer" dataField="iscritto"/>
                                  <s:GridColumn id="personaEventoGridPersonaColumn" headerText="Persona" labelFunction...../>
                                  <s:GridColumn id="personaEventoGridSocietaColumn" headerText="Societa" labelFunction..../>
                        </s:ArrayList>
              </s:columns>
    As you can see there si an itemrender. A checkbox is inside it.
    I also need to add dynamically new colums to my datagrid. Each new column has an itemrender with a checkbox.
    here the code to add a new columns:
    private function createNewColumn():void
                                            var newColumn:GridColumn = new GridColumn("column TEST");
                                            newColumn.itemRenderer = new ClassFactory(NewColumnCheckBoxRenderer);
                                            var  cols:ArrayList = new ArrayList();
                                            cols =eventoPersonaGrid.columns as ArrayList;
                                            cols.addItem(newColumn);
    The itemrenderer is the following:
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                      xmlns:s="library://ns.adobe.com/flex/spark"
                                                      xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">
              <fx:Script>
                        <![CDATA[
                                  import events.CheckBoxEvent;
                                  protected function eventoSubscribedCB_clickHandler(event:MouseEvent):void
                                            data.iscritto = ! data.iscritto;
                                            dispatchEvent(new CheckBoxEvent(CheckBoxEvent.UPDATE,data.iscritto));
                        ]]>
              </fx:Script>
              <s:layout>
                        <s:HorizontalLayout horizontalAlign="center" verticalAlign="middle"/>
              </s:layout>
              <s:CheckBox id="eventoSubscribedCB" selected="{data.iscritto}" click="eventoSubscribedCB_clickHandler(event)"/>
    </s:GridItemRenderer>
    As explained above cliccking on the checkbox inside datagrid definition, I need to change the checkbox properties that is located inside an itemrenderer.
    How can I do that?
    Is there a way to get the itemrenderer and checkbox references by the selectedItem datagrid property?
    thank you
    Pbesi

    Thanks harUI.
    Ok, I've to change how to face this kind of problems. Reading some articles I understood that there is not an itemrenderer for each row in a data grid. Instead, there are some itemrenderes (the number is the same of the visible rows in a datagrid) and they are applied on the other rows during the datagrid scroll. There no reason to try to get an itemrender instance. So the only way is to add these data inside a dataitem and get them with the "data" property. Ok, just is sounds strange for some properties to be carried on a valueobject because they aren't properties related to the data model (for example the infromation "checkbox is enabled/disabled"). Anyway it works. Thank you.
    Pbesi

  • Extending a component which already extends a spark list ItemRenderer

    Hello everyone,
    I have the following situation: Im displaying lists of very similar data objects (they extend the same parent) so in order to avoid a lot of changes to many itemrenderers (if i need to change something in the common properties) when displaying this data, i defined a spark list ItemRenderer (in MXML) which displays the common properties (file called BaseRenderer.mxml):
    <s:ItemRenderer>
         //in the script section i override the set data property
         //some MXML labels, checkboxes, etc
    </s:ItemRenderer>
    Then i created a specific itemrenderer which extended it (file SpecificRenderer.mxml):
    <model:BaseRenderer>
         //again i override the set data property
         //some ADITIONAL MXML labels, checkboxes, etc
    </model:BaseRenderer>
    When i run the app, and when the specific renderer is used, it works (no errors are thrown) , but it only shows the content of specific renderer, nothing from base renderer is visible. Is this the right way to do this, or do i have to override some additional stuff in my specific renderers?
    Thank you.
    One more thing, i just noticed, if i remove all MXML tags from specific renderer, the content from base renderer becomes visible, seems as if specific content overrides base content. Is there a way to add mxml tags into the specificrenderer?

    Yes i suspected them to be merged, and you gave me a great idea. As you say this behavior is true across all mxml defined components, not just itemrenderers. I want to avoid actionscript renderers because i dont (and wont) have any performance issues anyway and i like flexibility in design view, so instead i found another solution which i slightly modified. Some spark components inherit property mxmlContent, which you can override. This is what i came up with in the end: I added the property override into specific renderer and everything is shown as expected (because base elements are merged with the ones from extended component).
    override public function set mxmlContent(value:Array):void {
                                            var adding:Boolean = true;
                                            var index:int = 0;
                                            while (adding) {
        var element:IVisualElement = null;
        try {          element = super.getElementAt(index); } catch(e:Error) {          }
        if ( element != null )  {
           value.push(element);
           index += 1;
        else
          adding = false;
                                            value.reverse();
                                            super.mxmlContent = value;

Maybe you are looking for

  • How to read product characteristics of a line item in Billing document?

    Hi Friends,     I need to read the product characteristics of a line item in Billing document. Can you please help me with which tables or function modules I should use? Thanks in advance. Regards Jaker.

  • Audio capture lost after installing snow leopard

    Has anyone else had problems loosing their audio capture in Premiere cs4 after installing Snow Leopard?

  • Code works in DW8 but not DW CS3

    Why would the following code work in Dreamweaver 8 but not in Dreamweaver CS3? Expires in <select name="mnuExpires" id="mnuExpires"> <option value="0" >0</option> <option value="30" <% if true then response.write("selected") %> >30</option> <option v

  • I am trying to convert a pdf file from the Government Website.

    I am trying to convert a pdf file from the government site, it is a divorce petition item d008-eng.docx. Whenever I do the transcript is all over the place. Any suggestions? I have only bought the software to do this one thing and it failed.

  • Problems with the compiler?

    Hi all-, Can someone look into this?: In the below test, if I uncomment the first line, JSR014's javac fails, but CodeGuide (www.omnicore.com, features its own compiler) is OK. If I uncomment the second comment, both compilers complain: import java.u