List not correct selected Index

Hello

I have a list with a custom ItemRenderer.  When I raise the lstMessages_changeHandler(event:IndexChangeEvent):void event the selectedItem is always first in the list.  Once it is triggered, it does not occur again.  Looks like a simple thing to get the item... but I am at a loss.

Thank you in advance,

Paul

View the Code

<? XML version = "1.0" encoding = "utf-8"? >

" < = xmlns:fx s:View ' http://ns.Adobe.com/MXML/2009 "

xmlns:s = "library://ns.adobe.com/flex/spark" title = "The Wall" creationComplete = "init ()" >

< fx:Declarations >

<! - Place non-visual elements (e.g., services, items of value) here - >

< / fx:Declarations >

< fx:Script >

<! [CDATA]

import com.facebook.graph.Facebook;

import com.facebook.graph.FacebookMobile;

import com.trinet.bl.BusinessLogic;

import mx.binding.utils.BindingUtils;

import mx.collections. *;

import mx.managers.CursorManager;

import spark.events.IndexChangeEvent;

import mx.events.FlexEvent;

import mx.events.ItemClickEvent;

public private static var bl:BusinessLogic = BusinessLogic.getInstance ();

[Bindable]

public var posts: ArrayCollection collection;

protected function init (): void

{

bl.wallView = this;

bl.getWallPosts ();

}

protected function btnAdd_clickHandler(event:MouseEvent):void

{

CursorManager.setBusyCursor ();

bl.addWallPost ();

CursorManager.removeBusyCursor ();

}

protected function lstMessages_changeHandler(event:IndexChangeEvent):void

{

//var object: action = lstMessages.selectedItem;

//navigator.pushView (WallPostDetail, lstMessages.getChildAt (event.newIndex));

trace (event.newIndex);

}

]]>

< / fx:Script >

< s:Label id = "lblMessage" left = "10" right = "10" top = "10" text = "Message" / >

< s:Button id = "btnAdd" right = "12" high = "39" label = "Add" click = "btnAdd_clickHandler (event)" / >

< s:TextArea id = "txtMessage" left = "10" right = "96" top = "34" / >

< s:List id = "lstMessages" left = "10" right = "10" top = low "116" = "6".

Exchange = "lstMessages_changeHandler (event)" dataProvider = "messages from {}" fontSize = "20" "

itemRenderer = "renderer. LabelField WallItemRenderer"="message"> < / s:List >

< / s:View >

Code ItemRenderer

<? XML version = "1.0" encoding = "utf-8"? >

" < = xmlns:fx s:ItemRenderer ' http://ns.Adobe.com/MXML/2009 "

xmlns:s = "library://ns.adobe.com/flex/spark" >

< fx:Script >

<! [CDATA]

import mx.events.ItemClickEvent;

import com.trinet.bl.BusinessLogic;

import mx.core.FlexGlobals;

import spark.components.List.

[Bindable]

public var myBGColor:int = 0xFFFFFF;

mydata:Object private var;

override public function set itemIndex(value:int):void

{

if ((value%2) == 0)

{

myBGColor = 0xFFFFFF;

}

if ((value%2) == 1)

{

myBGColor = 0xCCFF66;

}

}

override public function set data(value:Object):void

{

mydata = value;

lblMessage.text = value.message;

var comments: Array = value.comments.comment_list;

lblComments.text = lblComments.text + value .comments .count;

lblLikes.text = lblLikes.text + value .likes .count;

}

]]>

< / fx:Script >

< s:Rect id = "myRect" left = "0" right = "0" top = low "0" = "0" alpha = "1.0" >

< s:stroke >

< s:SolidColorStroke color = weight of the "0xA8C6EE" = "1" / >

< / s:stroke >

< s:fill >

< s:SolidColor color = "{myBGColor}" / >

< / s:fill >

< / s:Rect >

< s:Label id = "lblMessage" left = "5" "5" = low top = width = "21" "458" fontSize = "15" text = "Label".

textAlign = "left" verticalAlign = "top" / >

< s:Label id = "lblComments" left = "10" low = "1" height = "12" fontSize = "12" text = "comments:" / > ""

< s:Label id = "lblLikes" left = low "111" = "1" fontSize = "12" text = "like:" / > ""

< / s:ItemRenderer >

in itemrenderer also override the method get itemIndex and data.

hope this will solve the problem.

Tags: Flex

Similar Questions

  • Converter Standalone 4.3.0 question - Get "the specified parameter was not correct" and no source listed volumes

    Sorry - hopefully an admin can move this to the correct forum. I could find no community forum labeled converter so no idea where to post this message.

    My first time trying to use the converter. Use the latest version of the Converter 4.3.0 to try a P2V by using the source computer. This is a laptop Dell D820 running Windows 7 Ultimate x 64 business. I chose the source machine and all the default settings. Destination product is VMware Workstation 7.x and target files are either local or to a port USB drive (tried both). In the last step, I get a yellow bar with the error "the specified parameter was not correct" "but the following quotes are empty and presume it suppose to say the name of the setting.» The only thing I see that is suspect is that if I click on change in section 'Data copy', the list of volumes and empty and assume that shouldn't be. The sample video to get advice on the use of converter on VMware support sites show a volume listed here. I tried the same approach on a completely different system under Vista SP2 and still no volumes appear so maybe it normal?

    No idea what I am doing wrong? I did export logs and watch and it appears no volume information has been captured (a lot of & lt; destroyed & gt ;) but even once, just guessing.) Any advice would be appreciated greadly.

    Thank you

    Don

    I had the same problem on a Win7 x 64 machine... There was no listed disk to convert.

    I managed to solve the problem by running the converter as an administrator. Right-click on the Desktop Converter icon and select run as administrator.

    The disks appears and you can select which can be the converter.

  • Adobe Acrobat 9: Javascript populated the drop-down list box - response selected array will not save

    I have a combo on one of my forms box that is filled with the help of a Javascript array.  The drop-down list box is filling very well, but when an item is selected in this drop-down list box, the selected item does not save when the user saves the document.  Any suggestions as to what is the problem and how it can be corrected?  I am a loss to know where even to start the search.  Any help is greatly appreciated.

    Thank you.

    Lisa

    It seems that the drop-down list box may be getting filled with code that runs when the form is opened. If so, it will overwrite the value selected, whenever it opens. The solution would be to change the code so that it is not than that. If not, you can post the form somewhere so we can take a look?

  • List of the albums of songs is not correctly displayed on any iPad

    I noticed that the list of Top songs is not correctly displayed on any of our Ipads, but it is on the iPhones.

    Please see the image below.

    It should be "Best songs" in the upper left corner, and where the 2 circles broken are inside should be read (Top Songs) & (Top Albums) in a border, like the other lists.  Because these buttons are missing, I can't use this list.

    I have a family membership to the apple's music, and the problem occurs on 4 separate Ipads, with 4 separate apple ID's

    I erased and reset the ipad, and to restart the problem is solved, however as soon as I finish the music to apple and then soft reboot the problem recurs.

    Anyone else have this or have any ideas?

    I have the same problem and not a clue how to solve this problem:

    Button of the top missing graphics on iPad.

    I guess it's a popular bug...

  • I get a message that my real time is not selected. I press 'Activate' and it stills is not correct the problem.

    Essentials microsoft security on my toolbar is shown in red. When I open it, it tells me that my real time is not selected and that I should turn it on. I press turn on button but it still does not correct this situation.  However, he told me that I am protected.  I've updated everything and I also ran a full scan but still does not help.

    Hi jomarie285,

    Uninstall and reinstall a new copy.

    Microsoft Security Essentials.

    http://Windows.Microsoft.com/en-us/Windows/Security-Essentials-download

  • lov search and select dialog restores do not correctly in 12.1.3 for skin of skyros

    Hello

    lov search and select dialog restores do not correctly in 12.1.3 for skin of skyros was resizable if 12.1.2 and used to render the best. Where can find the switch to override this behavior in my skin developed on top of office of skyros

    Thank you

    Nagarjuna Katta

    This is a patch to support

  • I try to register with a mixer via a usb connection. I can tell I have the settings correct, selected in the hardware Audio section. It worked before, but it's not. Any ideas? It's driving me crazy!

    I try to register with a mixer via a usb connection. I can tell I have the settings correct, selected in the hardware Audio section. It worked before, but it's not. Any ideas? It's driving me crazy!

    That entry of casings do you use on the Yamaha and what you've plugged into them? With the whole level at about 01:00 controls, as Neil suggests, increase the Gain until the red LED on the channel starts flashing. And then put it down a bit so that it no longer lights except very occasionally. You should then see the green signal LED flashes but not the red. You should then have reasonable level in hearing.

  • Not by selecting for viewing, but don't drop-down list box option

    Is it possible to have an option in a drop-down list box that is the first thing that people see, but not a selection? The field is mandatory, but I don't want the first option to be shown. For example:

    < select a >

    option 1

    option 2

    option 3

    Thanks in advance

    Nope.

  • Drop-down list does not appear selected value

    Hello

    I have a problem. The output of a query results page. There are 2 fields must be updated: scholarshipID and amount. I want to update my request at a time. My dynamic drop-down list does not appear selected value. The value is there, but it does not recognize in the drop-down list. I could not find the error. My code is below, so please help...

    < name cfquery = "getStudentsData" datasource = "#application. DSN #">"
    Select StudentID, fname, lname, GPA, Tbl_Students.ID, ScholarshipID, rise, Tbl_StudentsScholar.ID as the SSID, AwardStatus
    of Tbl_Students, Tbl_ApplyYear, Tbl_EduBckgrnd, Tbl_StudentsScholar
    where Tbl_Students.ApplyYr = Tbl_ApplyYear.id
    and Tbl_Students.id = Tbl_EduBckgrnd.SID
    and Tbl_Students.ID = Tbl_StudentsScholar.SID
    and ApplyYear = 1
    and steps = 7
    order by studentid
    < / cfquery >

    < name cfquery = "getScholarship" datasource = "#application. DSN #">"
    Select AcctNum, scholarship, Tbl_Scholarships.id, Code
    of Tbl_Scholarships, Tbl_DistCode
    where Tbl_Scholarships.DistCode = Tbl_DistCode.id
    AcctNum order
    < / cfquery >

    < cfparam name = 'X' default '0' = >
    < cfparam name = default "CounterX" = "0" >

    <!--get scholarship-->

    < cfif getStudentsDataRet.RecordCount eq 0 >
    < class p 'paragraph' = > No Records Found < /p >
    < class p = "pageheight" > < / p >
    < class p = "pageheight" > < / p >
    < cfelse >


    < class p = "submitmessage" > records found - < cfoutput > #getStudentsDataRet.Recordcount # < / cfoutput > < / p >
    < table width = "98%" border = "1" cellpadding = "3" cellspacing = "0" style = "" border-collapse: collapse "bordercolor ="#000000"align ="center">"
    < class tr = "steptext2" bgcolor = "#999999" align = "center" >
    < td width = "10%" > Student ID < table >
    < td width = "9%" > name < table >
    < td width = "9%" > name < table >
    < td width = "5%" > GPA Cum < table >
    < td width = "5%" > account # < table >
    < td width = "5%" > < table > amount
    < td width = "20%" > account # | Dist Code | Scholarship name < table >
    < /tr >

    < do action = "updateAward.cfm" method = "post" name = "AwardForm" > "
    < cfoutput query = "getStudentsDataRet" >
    < cfif eq x 0 and x neq getStudentsDataRet.recordcount >
    < cfset x = 1 >
    < cfelseif x neq (getStudentsDataRet.recordcount + 1) >
    < cfset x = x + 1 >
    < / cfif >
    < class = "paragraph" tr >
    < td > #StudentID # < table >
    < td > #lname # < table >
    < td > #fname # < table >
    < td > #GPA # < table >


    < cfif AwardStatus eq 2 >
    < name cfquery = "getStudentsScholar" datasource = "#application. DSN #">"
    Select Code, Tbl_Scholarships.id, AcctNum, scholarships
    of Tbl_Scholarships, Tbl_DistCode
    where Tbl_Scholarships.DistCode = Tbl_DistCode.id
    and Tbl_Scholarships.ID = #getStudentsDataRet.ScholarshipID #.
    < / cfquery >
    < / cfif >
    < td >
    < select name = "" scholarshipID_ #X # "onChange =" showMessage_ #X #(this.options[this.selectedIndex].value) ">"
    < option value = "" > < / option >
    < cfloop query = "getScholarshipRet" >
    < option value = "" #id # "selected < cfif getStudentsDataRet.ScholarshipID eq id > < / cfif > > #AcctNum # < / option >"
    < / cfloop >
    < / select >
    < table >
    < td > < input name = "" amount_ #X # "type ="text"size ="5"< cfif amount gt 0 > value = ' #NumberFormat (amount, 99.99) # ' < / cfif > / > < table >"
    < td > < cfif AwardStatus eq 2 > #getStudentsScholar.AcctNum # | #getStudentsScholar.Code # | #getStudentsScholar.Scholarship # | #getStudentsDataRet.ScholarshipID # < / cfif > < table >
    "< input name =" "IndexID_ #x #" type = "hidden" value = "#SSID #" / >
    < /tr >
    < / cfoutput >
    < cfoutput > < input name = "CounterX" type = "hidden" value = "" #getStudentsDataRet.RecordCount # "/ > < / cfoutput >"
    < b >
    < td align = "center" colspan = "11" height = "50" valign = "middle" > < input name = "Submit" type = "submit" value = "Submit" / > < table >
    < /tr >
    < / make >
    < /table >
    < / cfif >

    the syntax is: getStudentsDataRet.ScholarshipID [1]

    where '1' is the line number to specify

  • I have an index page that does not correctly load the css and css works on all other pages of the site.

    http://www.boulderridgecondos.com/ does not correctly load the css, but all other pages of the site loading the css correctly. There is nothing (that I can identify) between pages.
    http://www.boulderridgecondos.com/news.htm

    I guess something is wrong in the css, I inherited this site and have exceeded the css but can't find a problem that would cause this to happen.

    Any help or suggestion looking for something would be appreciated.

    This page is saved in UTF-16 format (Content-Type: text/html (UTF-16 BOM, litte-endian)) in your text editor. The CSS file is sent as ISO-8859-1. Firefox fun to see all the files in the same encoding. The other pages are send as ISO-8859-1 and so use the CSS file. You will need to re - save this page as ISO-8859-1 and download the corrected version.

  • How to change the selected index of a list of a DG?

    It is probably simple and I'm in the right place. I have a datagrid. When I select an element of the DG, he fills out a form that can be updated. One of the form fields is a list control with a remote object values. I want this list to highlight/select the value that corresponds to that of the DG when the item is selected. For example if I have a list of numbers 1, 2, 3, 4, 5 and the question that I select in the DG contains a 4, then I want the list to automatically select 4 as a default in the list when I select the element of the DG.

    You must loop through the result of your RemoteObject looking for a match, after that you have added to the list. I posted a sort of model of example to show what I mean, yours will be different of course, but I think you can grasp the concept based on what I'm trying to show.

  • Update KB976902 now the mouse doesn't work does not correctly

    I had the KB976902 recently updated on 2 of the 3 computers and 2 who got now have a mouse that does not correctly.  The computer number 3 does not have the update and still works fine.  All three are almost identical hardware and software and have legitimate versions of windows 7.

    The problem of the mouse made play almost almost impossible. Left click crashes, lag mouse click one or two times when I I try to do a restore from the left eventually drag a shortcut of the thing, I clicked on and don't know how or why.

    I did a restore on a single computer, but it did not help.

    Norton and McAfee applications are notorious for not to uninstall (or upgraded) themselves. Since you are not sure, I'll have to have executed two removal on all of the computers in question tools.

    NB: If a step said to reboot, reboot!

    1. download the Norton Removal Tool, save it to your desktop: ftp://ftp.symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe

    1B. download the tool McAfee Consumer Product Removal, save it to your desktop: http://download.mcafee.com/products/licensed/cust_support_patches/MCPR.exe

    2. close all open applications (that is, anything with an icon on the taskbar).

    3. right click on the file saved in # 1 above and select run as administrator to run the utility. DO TAP not your keyboard until the race ends, then restart.

    3B. right-click on the file saved in # 1 b above and select run as administrator to run the utility. DO TAP not your keyboard until the race ends, then reboot again.

    4 reset the IE8 advanced settings by http://windows.microsoft.com/en-US/windows7/Reset-Internet-Explorer-settings

    5. open Internet Explorer 32-bit (only!) to http://support.microsoft.com/kb/971058 & run it in DEFAULT and modes difficulty then AGGRESSIVE. [1]

    6. restart a last time & test.

    ~~~~~~~~~~~~~~~~~~~~~~~~
    [1] full Disclosure: the difficulty operating in AGGRESSIVE mode will remove your update history but not the list of installed updates.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • "The network adapter is not correctly configured to use the ip Protocol" problem on Vista

    Hello. My PC has recently came across this problem "the network adapter is not correctly configured to use the ip Protocol", every time I click on diagnose & repair. I don't know how to fix it. Please help, thanks in advance. Magic

    Hello X-x_MaGiC_x-X,

    Thank you for visiting the website of Microsoft Windows Vista Community.

    Try the rest of the stage in this article:

    System restore points are created automatically when the following occur:

    • When you install a new application or driver.
    • When you uninstall or install some programs.
    • When you install new updates
    • Automatically on a daily interval
    • Manually by creating a.
    • If you choose to use system restore to restore to a previous restore point, System Restore creates a new restore point before you restore a previous state in case something goes wrong. If you are restoring to a previous state in Mode without failure, a restore point will create for the current state.

    So that the restoration of the system to work, you must have 300 MB of free space for each hard disk that monitors the system restore. System Restore will also use up to 15% of disk space on each disk that it monitors. That hard disk space runs out, older restore points will be deleted as newer ones. It is also important to note that you must be logged in as an administrator in order to use the system restore. Now that you understand the basics of the system restore, you must continue to the next section to learn how to use it.

    Restore Windows Vista to a previous state

    In the case of a problem on your computer that cannot be solved by normal means, you can restore your computer to a previous working state. To do this, you need to start restoring the system so that you can choose the restore point to restore. If you currently have Windows Vista boot problems, you can use the system restore in Windows recovery environment. Instructions on how to do it in this tutorial can be found: System Restore using the Windows Vista recovery environment.

    If you can connect to Windows Vista, you must follow these steps.

    1. Close and save any documents that you have opened.
    2. Click the Start button to open your Start Menu. The Start button looks like this:
    3. When the Start Menu open click on the menu option all programs.
    4. Click once on the Start Menu Accessories group.
    5. Click once on the System Tools Start Menu group.
    6. Click once on the icon of the system restore. After you click the icon, if a user account control window opens, click on the button continue.

    You will now be on the screen as shown below in Figure 1 system restore. From this screen, you can specify the restore point that you want to restore.

    1 screen of system restore

    By default, Vista will be already selected the restore recommended option. This restore point is one followed a new pilot program, or update has been installed. If you do not want to use this restore point, you can click on the button next to start the restore process. On the other hand, if there is a more recent restore point that you want to restore you should select choose a different restore point and press the next button. This will bring you to a screen, as shown in Figure 2, which contains a list of all available restore points that you can restore.

    2. the list of available restore points

    You must select the restore point that you want to restore, and then press the button next to start the restore process. Vista will display a window showing your selected restore point and asking you to confirm that it is that you want to restore.

    3. confirm the selected restore point

    If you want to select a different restore point, press the Back button. Otherwise, you can press the Cancel button to exit the system restore or the button finish to begin the restore process. If you have selected finish, Vista will display a second prompt asking you to confirm that you want to continue restoring.

    4. second Confirmation

    If you are sure you want to restore, then press the Yes button. Vista will now log you off the computer and start the system restore process, as shown in Figure 5 below.

    5. restoration of a restore point

    When the restore is complete, your computer will be restarted and when Vista starts it backup will be restored to its previous state. When you open a Vista session for the first time after the restore, you will see a message indicating that the restore was successful.

    6. system restore was successful

    If there are problems with your computer because the last restoration, you can return to your previous settings to ebb in the system restore utility and select Undo system restore by pressing the next button.

    7 undo the last system restore

    Your computer should now work correctly again.

    With the help of the restoration of the system in the Windows recovery environment

    Manual creation of Restore Points

    As mentioned previously, it is also possible to create manual restore depending on points. Some popular designs to create manual restore points are when you have your computer configured perfectly and I would save the State in case of problems in the future. To create a manual restore point, you must follow these steps:

    1. Click the Start button to open your Start Menu. The Start button looks like this:
    2. Click on the control panel menu option.
    3. Click the option menu system and Maintenance.
    4. Click on the system menu option.
    5. Click on the System Protection in the list on the left.

    You will now be at the System Protection tab in the system control panel. This tab allows you to enable and disable the system restore as well as making the new manual restore points.

    8. the System Protection tab

    To create a manual restore point, you must click on the button create. When you press this button a prompt asking you to give a title to this manual restore point.

    9. Enter the manual restore point title

    Type a title for the manual restore point and press the button create. Vista will now create a restore point manually and once finished, post a notice that it was created successfully.

    10. Manual restore point has been created

    Now that you have finished doing the manual restore point, you can close the system window.

    Try to download the correct and up-to-date drivers.

    This should solve your problem.

    Let us know if these steps solve your problem.  I hope the information is useful.

    Kind regards

    Anthony
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I'm administrater whenever I have download something and you try to open it say parmiters not correct with the result that the average and especially if it worked yesterday how does this error occurs

    Please tell me how or what to reset the paramiters I admin I think someone is intentionaly changing settings so I can't access my computer not very good in this area and need to know

    Try a system restore to a Date before the problem began:

    Restore point:

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    http://www.windowsvistauserguide.com/system_restore.htm

    Read the above for a very good graph shows how backward more than 5 days in the System Restore Points by checking the correct box.

    See you soon.

    Mick Murphy - Microsoft partner

  • Speakers not working do not correctly under Vista

    Description
    Windows has detected a new device attached to your computer, but did not find the driver software, to make the device usable. Each device manufacturer typically includes the driver from a CD that comes with the device, or for download on its Web site. Your device hardware ID is USB\VID_069B & PID_0705 & REV_0101.

    Signature of the problem
    Problem event name: PnPDriverNotFound
    Architecture: x 86
    Hardware ID: USB\VID_069B & PID_0705 & REV_0101
    The system version: 6.0.6002.2.2.0.768.3
    Locale ID: 1033

    Additional information about the problem
    Bucket ID: 7122630

    * original title - 2 different sets of speakers connected to the computer, worked last week, but not now! UGH! Thank you for your times

    Try a system restore to a Date before the problem began:

    Restore point:

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    http://www.windowsvistauserguide.com/system_restore.htm

    Read the above for a very good graph shows how backward more than 5 days in the System Restore Points by checking the correct box.

    See you soon.

    Mick Murphy - Microsoft partner

Maybe you are looking for