How do i set spark list selected item's color??

hey guys... so got a little problem... i have a spark list which gets populated from a array collection that looks likda like this
[0] = "name1"
[1] = "name 2"
[2] = "name 3"
when i click on say "name 1" i  need the color of "name 1" to change to say red...
and when i click on another item i need that color to stay... red on "name 1"...
oh and... i need to do the color change in actionscript rather than the mxml file...
any ideas???

Hi,
I'm not sure if this is exactly what you are looking for. What I did was created an itemRender for the list and assigned it like so
<s:List dataProvider="{ listDataProvider}" itemRenderer="listItemRenderer"/>
And the listItemRenderer will look some
//Code Begins
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          xmlns:mx="library://ns.adobe.com/flex/mx"
                          focusEnabled="true" >
    <fx:Script>
        <![CDATA[
            var clicked:Boolean=true;
            protected function clickHandler(event:MouseEvent):void
                    clicked?labelRender.setStyle("color","0x00FF00"):labelRender.setStyle("color","0xFF0000") ;
                    clicked=!clicked;
        ]]>
    </fx:Script>
    <s:Label  id="labelRender" text="{data}" color="0xFF0000" click="clickHandler(event)"/>
</s:ItemRenderer>
//Code Ends
In the above example the colour toggles on each click. So, you can apply anything. assume you have a property called color in your array collection, you can access it as data.color and then set the text to that color when it is clicked. I hope this helps. Do write back if you have any issues.
Nishad

Similar Messages

  • How to access spark list selected items

    selected items is some sort of vector? I can't access the items in it, can anyone shed some light on how to acess them? Maybe print them to the screen?

    I too am dragging through the documentation with a fine toothed comb and am at a loss of how to get something as simple (and intiutive) as myList.items.
    Maybe I'm overthinking it, but if I have a custom item renderer with a checkbox in it and when the user clicks the checkbox and it's selected state changes, I'd like to let the List that contains the List Item know of it... not that the item was messed with, but more to the point, that the checkbox was messed with and which item it was a member of...
    Right now I can't even figure out how to do something as rediculously simple as creating a creationComplete handler that iterates through the list items and calls a function in them to set a reference to itself that the list item can reference.     

  • Disable Spark List selection indicator

    How do I get rid of the Spark List selection indicator entirely?  I don't want the rectangular indicator when the mouse hovers over an item, and I don't want the color to change when the mouse is clicked.

    You'll have to extend default item renderer (ItemRenderer for instance) and set autoDrawBackground to false. And then use your item renderer in a list.
    See this document for more information on spark item renderers.

  • How do I set numbered lists for headings in Pages 5.2, and keep that system of numbered lists saved?

    I have tried to set numbered lists for headings in Pages 5.2 but have not succeeded. I have read similar questions concerning this but this has not helped me...
    When I say numbered lists I mean something extremely important and simple, for instance:
    1. Introduction
    1.1. Background
    1.2. Purpose and Questions
    2. The Legality of Clause X
    2.1. Legality under Article 101.1
    2.2. Legality under Article 101.3
    And so on...
    Heading 1. is selected as "Heading", 1.1 is selected as "Heading 2", and if I had 1.1.1 it would be selected as "Heading 3" and so on...
    I have navigated my way to the Format window, and under the tab "Style" and down to "Bullets & Lists". I have here selected the following: Numbered, Numbers, 1. 2. 3. 4., Tiered Numbers, Continue from previous.
    There are several problems with this currently.
    First, based on the example it becomes "2. Background" when it should be "1.1 Background" instead.
    Second, after writing some body text between the headings and then select a new heading, all the previously selected settings I mentioned above in "Bullets & Lists" have to be reselected.
    So, how do I set numbered lists for headings, or so called sub-headings, in Pages 5.2? And how do I keep that selected system of numbered lists saved so I don't have to retype it for every new heading I type? (e.g. so that Pages knows that every time I choose Heading 2, I want it to number the heading in the way selected)
    Obviously, manually writing the numbers for every heading is not a viable option, as it makes table of contents problematic and is simply tedious. You need an automatic way of doing it, especially if you write long documents where keeping headings in order is absolutely essential.
    Also, reverting back to previous Pages versions (like v. 9 I think?) is not an option as that does not exist on my recently purchased Macbook Pro.
    I need to be able to do this on Pages 5.2 and do it automatically.
    I appreciate any help with this.

    iWork '09 is not "outdated" it still works and works extremely well and whilst not perfect with MsWord it is far far better than Pages 5.2 which has a stream of major issues with exporting. It is also way better and faster to use than Microsoft Office.
    So what is your time and work actually worth? If it is less than $19.99 for 6 months, you may as well just chuck it in and take that job on minimum wages.
    You are assuming things for Office 2014 with absolutely no inside knowledge. Much as we assumed Pages 5 was going to be the long awaited improvement, but ended up being a downgrade to match the iOS version, Microsoft is headed the same way with their mobile versions.
    This is not like getting the "latest" pair of pants where you go with the crowd and throw out your cigarette legs which replaced the flares, which replaced your low cuts which replaced your cigarette legs, which replaced…
    This is work.
    If it does the job and does it well, use it. There is nothing out there to really match what Pages '09 does. Yet.
    LibreOffice can do most but not all, but has a UI that only a mother could love. It's great redemption is that it uses both open formats and the standard Microsoft formats and is under active development. It also opens and saves to just about everything. When they finally work out the Pages formats, I'm sure they will open those as well.
    I use a lot of professional software. Just because the publisher's marketing department says change the product so we can sell more, doesn't mean you have to pay any attention whatsoever. Adobe being a classical example. Most designers are just ignoring their latest subscription based bloatware and getting on with their work.
    Peter

  • How do we set "Link That Displays Item In Full Browser Window" property?

    How can we set "Link That Displays Item In Full Browser Window" property? I could not find it. Thanks...

    I assume you're using Portal 3.0 (it always helps to mention which portal version you're using).
    I suggest you search this forum for "new window". You'll find several threads discussing how to implement this feature in Portal 3.0.
    Regards,
    Jerry
    PortalPM

  • How to move to the next Selected Item in a list.

    *Edited*
    I was just wondering how I could make a button which would move the currently selected item to the next in the array loaded into a List component. I would think to do it through AS or an event, but I'm not sure what I would reference in accordance to that component. The help would be appreciated, thank you.

    You can set the selectedIndex. When next button is clicked increment the selectedIndex.
    If( list.selectedIndex < list.dataProvider.length - 1 )
         list.selectedIndex++;

  • How to have a unique list of items for separate dropdown lists?

    Software: Acrobat X (10) pro on Windows
    I want to create a pdf form in which all dropdown lists are populated with the same list of items to choose from. If I use the same field name for all drop down lists, the item selected in one dropdown list is automatically selected in all lists. This is not what I want. I wish to be able to select a different item in each & single dropdown list. I could of course maintain separate item lists for each field (using separate field names) but what a waste of time!... especially as the field lists would then have to be updated separately. There's got to be a better way to do it.
    Any idea how this could be achieved? Thank you.

    Here's a sample script that first defines a list of items in an array and uses it to update a number of dropdowns, name dd1...dd10:
    // Populate an array with the list items
    var aItems = ["-- Select a state --", "Alaska", "Hawaii", "Washington", "Oregon", "Idaho", "Montana", "Wyoming", "Nevada", "Colorado", "Arizona", "New Mexico"];
    // Loop through the dropdowns...
    for (var i = 1; i < 11; i += 1) {
        // ...and set the list items
        getField("dd" + i).setItems(aItems);
    That's all there is to it. This can be run from the Mouse Up event of a temporary button that you create, the interactive JavaScript console (Ctrl+J), etc.
    More info on setItems: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.752.html

  • Getting a lists selected item itemRenderer's properties

    Is there a way to get a Spark List's selectedItem itemRenderer's contentToGlobal x and y and it's height values?
    Thanks,
    John

    Hello Shongrunden;
    Thanks again for your help, if you don't mind me asking a couple of more questions...
    - With a scrollable Spark List, if a selected item is partially in view, is there a method to get just the visible height of the itemRenderer?
    - Also, on my custom paged List component, with a custom itemRenderer and useVirtualLayout = true, after the list data is retrieved a resultHandler is called, in this I then call your getRendererCoordinates function.  I also call  getRendererCoordinates() in a listChangeHandler.
    After the resultHandler calls getRendererCoordinates, even though the dataGroup is showing the proper number of elements, and I set the list.selectedIndex to 0, the renderer variable created in;
    var renderer:IVisualElement = list.dataGroup.getElementAt(list.selectedIndex);
    the renderer var returns null on the initial display called from the resultHandler, but ... it works perfect on on the listChangeHandler and subsequent page displays.  So it seems the renderer is not finished being drawn when getRendererCoordinates is being called from the resultHandler, but subsequent page displays work probably because the renderer has already been drawn.  I've tried callLater(getRendererCoordinates) but since nothing else is going on it won't trigger.  I did not see an event that can be dispatched from IVisualElement after it is completely drawn that I can use to call getRendererCoordinates.
    Any suggestions?
    Thanks again for your help and time,
    John

  • Spark List Itemrenderer items outside of List

    I have a spark list and i want some of the items in it to appear out side of the list depending on the users interaction.
    Is there a way to make items of an item renderer appear outsid of the LIst container?
    When i use basic layout on the lsit and explicitly set the x and y, they appear behind the list.
    Thanks.

    Hi jmandawg,
    My ListRenderer.mxml may be what you want as follows,
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer 
    xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
    library://ns.adobe.com/flex/spark" xmlns:mx="
    library://ns.adobe.com/flex/mx" hide="mOut(
    null)" mouseMove="mOut(event)" mouseOut="mOutValueItem(event)"mouseDownOutside="mOut(event)" creationComplete="inited()"
    autoDrawBackground="
    true">
    <fx:Script>
    <![CDATA[
    import mx.controls.TextInput; 
    import mx.managers.PopUpManager; 
    import mx.utils.StringUtil; 
    import flash.text.TextLineMetrics; 
    public var mouseOnPopup:Boolean = false;  
    public var vi:mx.controls.TextInput; 
    private function inited():void {vi =
    new mx.controls.TextInput();vi.editable=
    false;vi.addEventListener(MouseEvent.MOUSE_OUT, mOut);
    vi.addEventListener(MouseEvent.ROLL_OUT, mOut);
    vi.addEventListener(MouseEvent.MOUSE_OVER, mOverPopup);
    private function mOut(event:MouseEvent):void { 
    if ( vi.isPopUp ) {PopUpManager.removePopUp(vi)
    mouseOnPopup =
    false;}
    private function mOverPopup(event:MouseEvent):void {mouseOnPopup =
    true;}
    private function mOutValueItem(event:MouseEvent):void { 
    if ( vi.isPopUp && !mouseOnPopup) {PopUpManager.removePopUp(vi)
    private function mOver(event:MouseEvent):void { 
    var txt:String = itemValue.texttxt = StringUtil.trim(txt);
    if(txt.length<5) return; 
    if(!vi.isPopUp) {PopUpManager.addPopUp(vi,
    this.parent)vi.text=txt;
    vi.setStyle(
    'fontSize',18); 
    var txtMetrics:TextLineMetrics = vi.measureText(vi.text);vi.width=txtMetrics.width*1.2
    vi.height=itemValue.height*1.4
    var p:Point = itemValue.localToGlobal(new Point(itemValue.x, itemValue.y));vi.x=p.x;
    vi.y=p.y-10;
    ]]>
    </fx:Script>
    <s:TextInput id="itemValue" text="{data.value}" width="200" mouseOver="mOver(event)" mouseOut="mOutValueItem(event)" mouseMove="mOut(event)" editable="false"/> 
    </s:ItemRenderer>
    You may test it with the following in your main.mxml
    Bindable] 
    private var detailAC:ArrayCollection = new ArrayCollection([{value:"nteDevice.device"},{value:
    "nteDevice.deviceTypenteDevice.loopbackIpAddr"},{value:
    "nteDevice.ipAddressnteDevice.loopbackIpAddr"},{value:
    "nteDevice.loopbackIpAddrnteDevice.loopbackIpAddr"}, {value:
    "nteDevice.release"},{value:
    "nteDevice.releasenteDevice.loopbackIpAddr"},{value:
    "nteDevice.clli"},{value:
    "nteDevice.provisionStatus"}]);
     <s:List id="lst" itemRenderer="com.att.ntscp.view.component.ListRenderer" dataProvider="{detailAC}" width="200" height="200"/>
    Is it a little bit trick?
    Jeffrey

  • How to make a listbox selected item highlight color from code the same as if user click on item?

    Hi all,
    I have a listbox that gets filled with data when my program starts. I save the last selectedItem value so I set it when the program start again. But the color that the selected item has is not the same as if the user click on it (pictures below).
    The color when I set the selectedIndex=someItem is black on light grey (background)
    The color when the user clicks on the item is white on blue (background)
    Any way to make them both white on blue (background)?
    Thanks
    This is the user clicking on it:
    This is the code:

    I think the difference is focus.  When you use the mouse to select it also sets focus to the listbox so you would have to set focus to the listbox when you set the selected item.  How are you setting your selected item?  I think that by
    using a property to hold the selected item rather than setting the index that might also fix the problem.
    Lloyd Sheen

  • How to find total size of selected items in library

    My library contains much more than my 2GB Nano can hold. I frequently change the content of the Nano with songs and books. How can I keep track of the total size of items I'm selecting for the next Nano update to speed my update? Presently I can only guess what to unselect if the selections are of greater size than my Nano will hold.

    There is no direct way to accumulate total file size when selecting a subset of songs within the Library or a Playlist.
    The only way you can manage this is to create an empty Playlist that you can drag songs into. It will accumulate the total size of the songs as you deposit them into it (as described by StarDeb above).
    If you get to a size greater than the nano will hold, then remove one or more songs from that Playlist.
    There is no 'running-total' of only the selected items like Windows Explorer does. Sorry.

  • How to use SET ID in select statement of SQ02

    Hi,
    I have a infoset, where for one of my Zfield, i have writen a select statement in order to get my ouput.
    if aufk-aufnr = 'XYZ'.
      select sum( FKBTR ) from fmifiit into zfmifiit
      where fikrs = aufk-kokrs
      and fipex IN capex
      and wrttp NE '51'.
    endif.
    For the above statement, i have created (with 10 single values, table name FMCI, field name FIPEX)  a SET id named CAPEX and used with IN operator.
    But when i generating the infoset i am getting error like below
    The IN operator with "CAPEX" is followed neither by an internal table nor by a value list
    I was using IN opeartor for set ids during validation / substitutions, where if i have to validate multiple single values.
    What to do here?
    Regards,
    Srinu

    [OPEN-SQL|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_GENERAL.htm] set of statement, [SELECT|http://help.sap.com/abapdocu_70/en/ABAPWHERE.htm] statement, [WHERE|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP.htm] addition requires a selection table (type range, [WHERE - IN seltab |http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_SELTAB.htm]) of parameter and not a set. We are in Abap here, not in a Customizing screen
    You have to convert the set to a selection table in an ABAP coding before using it in a SELECT statement.
    (Check FM like G_SET_TREE_IMPORT to import definition of set (values and intervals) and map them to a select-table, or ask a developper to perform it, look at G_SET_TREE_IMPORT -> select statement)
    Regards,
    Raymond

  • How do I get rid of "Selected Item" window?

    Just updated iTunes to version 7.5 and I notice a window below the listings of my playlists (left side of screen), thus reducing the number of playlists that I can see. I would rather that the "now playing/selected item" window not be there so I can see more of my playlists and reduce scrolling. Is it possible? Thanks.

    If your CDs are marked as Compilations then you can see them by switching on the compilations feature in the browser. Go to Edit>Preferences>General and check the box "Group Compilations when browsing". When you switch the browser on Compilations will be the first item in the Artist pane, click on it and your compilations will then be listed in the Album pane. If you made these CDs yourself you'll need to mark all the tracks as part of a compilation and give them an album name (you can use the name of your playlist for example). To change the info on multiple items such as all the songs in a playlist, click on the first track you want to add information then while holding down the shift key click on the last track in the list, this will highlight all in between. Right click on the list and choose Get Info, you get a dialogue box asking if you want to update multiple items, click Yes and then the Info tab. Type in the album name and choose Yes from the drop down menu below "Compilation" which is on the bottom row of the info window then click ok and this will ensure the whole selection is identical.

  • How to check if a list contains items from another list

    Hi all,
    I am trying to check whether a text list contains items form
    another list and then do something. I tried:
    tlist contains text phrases (e.g., test1,test2,test3)
    phrases = ["test1","test2"]
    n = phrases.count()
    tList.getPos(phrases.item[n])
    alert("should not be inluded in the list")
    But it is not working any ideas why?

    myPhrase is the loop index, but instead of a numerical index
    (like n in your sample), myPhrase is set equal to each item in the
    phrases list, first item to last. So, on the first iteration
    myPhrase = “test1”, on the second iteration myPhrase =
    “test2”. The loop automatically exits when the end of
    the list is reached. The Director help docs have more information
    on this syntax under “repeat”
    BTW: if you're more comfortable using a numerical index, the
    syntax for getting at the n-th item in a list is list[n], or in
    your sample phrases[n]

  • How do i alphabetize a list of items in pages

    I need to alphabetize a list of item sin pages

    Best to ask in the Pages forum!
    https://discussions.apple.com/community/iwork/pages

Maybe you are looking for

  • Strange drastic video playback lag. Help!

    I will keep this short and to the point. I can open and play video just fine be it a image sequence to a hand drawn frame animation with hundreds of complex layers animating at once but as soon as sound is included I have a 20+ second wait before nor

  • BED AND ECS AMOUNT IS MORE IN MIGO EXCISE HEADER TAB

    Hi Guys, When I am processing the MIGO, in exise tab(Header) the amount of BED and ECS are 10 time more than the acctual amount. Where as the Item details Excise tab it is correct as per the Purchase order. Can some body tell me how/from where this h

  • IBook G4 with red light on charger

    Hello, I have this problem of starting up my iBook G4. It doesn't turn on at all when I press the power button. At first, I thought it was low on battery. So, I charged it and the red light is on no matter how long I charged it. May I know what does

  • Which Keynote fonts & transitions are compatible with Powerpoint?

    Hi, I've used some jazzy transitions in my Keynote and will export to Powerpoint and play it from a PC. Now I'm told that there might be compatibility issues with the transitions. Can anyone tell me what are the safe transitions I can use in Keynote

  • Update the item in repository

    Hi i am getting data from orderrepository after that i have one statement like orderRepository.updateItem(ciItem); why we need to call updateItem(ciItem); metod after completion please give me clear picture on it