ItemRenderer fails values update with sorting applied to the ArrayCollection (dataProvider) collection

Hi all

IM updating the ArrayCollection collection which is the source of my list component

(the email never changes)

o:Object = {user:"username",email:"emailAdress",state:"number",imageURL="urlToImage"} //This comes from a function and arrives well.

for (var j:int = 0; j < _arcUserList.length; j++) 
     {
          if(_arcUserList.getItemAt(j).email == o.email)
           {
                //_arcUserList.setItemAt(o,j) //I've tried this but doesn't work too!!

              _arcUserList.getItemAt(j).user = o.user;
              _arcUserList.getItemAt(j).email = o.email;
              _arcUserList.getItemAt(j).state = o.state;
              _arcUserList.getItemAt(j).imageURL = o.imageURL;
              _arcUserList.itemUpdated(_arcUserList.getItemAt(j));


          }
      }

It works fine without the following sorting settings, but if I add to that that the lines in the init () it gives me:

Error #1009: cannot access a property or method of a null object reference (in the first line of the function onChange of the converter in red below)

var iSortByState:ISortField = new SortField("state",true);
var iSortByName:ISortField = new SortField("user",false);
var sort:Sort = new Sort();
sort.fields = [iSortByState,iSortByName];
_arcUserList.sort = sort;
_arcUserList.refresh();

Here I post my element converter

<?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" 
                                        width="100%"
                                        autoDrawBackground="true" 
                                        creationComplete="fncInit(event)"
                                        dataChange="onChange(event)">
          <s:layout>

                    <s:HorizontalLayout gap="10" horizontalAlign="left"
                                                                      paddingTop="5" paddingBottom="5"
                                                                      paddingLeft="10" paddingRight="10"
                                                                      verticalAlign="middle"/>
          </s:layout>

          <s:Image id="_imgUser" height="32" width="32" />
          <s:VGroup width="70%">
                    <s:Label id="_lblUsername" fontSize="12" fontWeight="bold" />
                    <s:Label id="_lblState" color="#868686" fontSize="10" fontStyle="italic" /> 
          </s:VGroup>
          <s:HGroup width="100%"  horizontalAlign="right">
                    <s:Button width="40" label="@" click="onClickButton(event)" visible="false"/> 
          </s:HGroup>



          <fx:Script>
                    <![CDATA[
                              import flash.filters.*;

                              import mx.collections.ArrayList;
                              import mx.controls.Alert;
                              import mx.events.FlexEvent;
                              import mx.events.StateChangeEvent; 


                              [Bindable]private var arrStates:Array =["Disconnected","Busy","Available"];

                              [Bindable]private var _nState:Number;
                              [Bindable]private var _sImgURL:String;
                              [Bindable]private var _sUser:String;
                              [Bindable]private var _sEmail:String;



                              protected function fncInit(event:FlexEvent):void
                              {
                                        _nState = this.data.state;
                                        _sImgURL = this.data.imageURL;
                                        _sUser = this.data.user;
                                        _sEmail = this.data.email;



                                        this.setStyle("contentBackgroundColor","0xFF0000");

                                        _imgUser.smooth = true;
                                        fncLoadPicture(_sImgURL);

                                        _lblUsername.text = this.data.user;
                                        _lblState.text = arrStates[this.data.state];

                              }

                              private function fncLoadPicture(sURL:String):void{
                                        var context:LoaderContext = new LoaderContext();
                                        context.checkPolicyFile = true;
                                        context.applicationDomain = ApplicationDomain.currentDomain; 
                                        var fotoLoader:Loader = new Loader();
                                        fotoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
                                        fotoLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onImageError);
                                        fotoLoader.load(new URLRequest(sURL), context);
                              }

                              private function onImageLoaded(event:Event):void {
                                        var bmp:Bitmap;
                                        bmp = ( event.target as LoaderInfo ).content as Bitmap; 
                                        _imgUser.source = bmp;


                              }

                              private function onImageError(event:Event):void {
                                        Alert.show("Error loading imabe.", "Alert");
                              }



                              protected function onClickButton(event:MouseEvent):void
                              {
                                        trace(data.user+": "+data.state); 
                              }


                              protected function onChange(event:FlexEvent):void
                              {

                                        _lblUsername.text = this.data.user; //if i comment this, it fails in the next and so on.
                                        _lblState.text = arrStates[this.data.state];
                                        fncLoadPicture(this.data.imageURL); 

                                        var glow:GlowFilter = new GlowFilter();
                                        glow.alpha=0.8;
                                        glow.blurX=2;
                                        glow.blurY=2;
                                        glow.strength=30;
                                        glow.inner=false; 
                                        glow.quality=BitmapFilterQuality.HIGH;

                                        switch (this.data.state.toString())
                                        {
                                                  //Disconnected - Invisible
                                                  case "0":
                                                            _lblUsername.setStyle("color",0x555555);

                                                            glow.color=0x6E6E6E;

                                                            var matrix:Array = new Array();
                                                            matrix=matrix.concat([0.4,0.4,0.4,0,0]);// red
                                                            matrix=matrix.concat([0.4,0.4,0.4,0,0]);// green
                                                            matrix=matrix.concat([0.4,0.4,0.4,0,0]);// blue
                                                            matrix=matrix.concat([0,0,0,0.5,0]);// alpha
                                                            var cmf:ColorMatrixFilter=new ColorMatrixFilter(matrix);
                                                            _imgUser.filters=[cmf,glow];

                                                  break;

                                                  //Busy
                                                  case "1":
                                                            glow.color=0xDF0101;
                                                            _imgUser.filters=[glow];
                                                            break;

                                                  //Available
                                                  case "2":

                                                            glow.color=0x01DF01;
                                                            _imgUser.filters=[glow];
                                                            break;

                                        }


                              }

                    ]]>
          </fx:Script>



</s:ItemRenderer>

It works fine until I put the sort.

Any suggestion?

Your rendering engine must handle data being null without raising an error.

Tags: Flex

Similar Questions

  • 0xC1900101 - 0 x 20017 installation failed during SAFE_OS with an error during the START operation

    When you try to upgrade Windows 7 SP1 to Windows 10 ' 0xC1900101 - 0 x 20017 installation failed during SAFE_OS with an error during the START operation "is a problem recurring and none of the solutions posted for a Samsung RV511 work.

    When will there be a solution of Microsoft?

    Concerning

    Hello

    Since Windows 10 is a completely new operating system, the computer manufacturer might still not have designed and developed drivers for it. As suggested waiting for the manufacturer to release the necessary drivers for the hardware and then try the upgrade.

  • Shares advanced with effect applies on the click boxes

    Hello!

    I could use some help troubleshooting one of my projects.

    I use a couple of clickboxes that perform distinct advanced actions - by clicking on the first clickbox (CB1) shows a picture, a text caption and click box (CB2) that appear with a fade-in effect apply (see the + ApplyEffect). Then, once everything is displayed, CB2 makes all melted (ApplyEffect only). It's like a pop - up glorified that fades in and out. It works very well... once!

    The problem is that if CB2 hides everything stated by CB1, I can open and close until the cows come home. However, as soon as I replace Hide to apply effects (fadeout) in advanced actions, he won't again. I click on CB1 but nothing happens.

    What I think is that CB2 is not hiding anything (only fades them out of sight) and when I click on CB1 the second time, it displays them, but I don't see it because they are always made disappear.

    I tried to add assign rdcmndGotoFrameAndResume with v_startframe at the end of advanced action of CB2, but nothing helped. Simply, he jumps the fadeout and go to the first image.

    Is it possible to delay my last action? Or maybe I do not have that sense. just started using advanced actions.

    Thank you!

    First define the variables two user I've been using: v_start and v_fadeout. No need to give them a default value.

    On the slide, in the properties, Action on enter, accordion panel you choose entitled and in the drop-down list, you select v_start and then you will need to type in the system variable $$rdinfoCurrentFrame$ $. I find it easier to make a standard advanced trigger action on enter, because in the dialog shares advanced, you can also select this variable system instead of having to type it. With this action, the value in the v_start variable will be the first image of the slide number.

    For buttons, unlike the click boxes, you can time the point of suspension in the properties, timing Accordion Panel. Here, you can type in 6 to "Pause after '... You can display two buttons during the rest of the slide (CTRL-E).

    It will automatically return to the first image, that's what makes the rewind button: assign rdcmndGotoFrameAndResume with v_start.

    There is no possibility of time in a tip action.

    Explanation of Expressions: in the first expression, I calculate the number of frames corresponding to 6 seconds. the variable rdinfoFPS system automatically gives the number of frames per second, default value is 30. If the first expression will result in 180 frames. But I have to navigate to the absolute number of this framework from the beginning of the project. That's why I add the number of the first frame of the slide that is stored in v_start.

    Lilybiri

  • Update Windows KB936330 fails to update, no error msg, starts the update but then, UN-installs

    Tried to update with disabled antivirus. Don't know what else to do. can anyone help?

    Hi jenniferbiddulph,

    You are able to correctly install the other updates?

    In order to diagnose the problem, you can check in the update history if there is an error code.

    For more information, refer to this link: see which Windows updates are installed

    You can follow this link & check if the problem persists:

    How to troubleshoot the installation of the service pack, Windows Vista and Windows Server 2008 problems?

    Reference: what you need to know before installing Windows Vista Service Pack 1

    Hope the helps of information.

  • Faced with ' sort by ' in the Panel project CS6 display icon

    Hi all

    I wonder if everyone is faced with the following text:

    I imported a bunch of gopro files in a bin in my project Panel. When in list mode, I can sort by name, duration, no matter. However, when I go to the icon display the ' sort by ' settings are not kept - my files seem to appear in a random order, which makes it very difficult to keep track of them.

    Are there any hidden feature, I did not to allow me to sort files in the icon display?

    The display of the icon looks like a Storyboard, you can drag clips autour, you cannot sort.

    Please file a feature request in order to sort in the display of the icon.

    FEATURE request

  • Can Firefox users annoyed with changes apply in the recent updates, other reccomed browsers that are similar to the use of Firefox to be?

    And please get this done by reference... Google org.

    delete messy, juvenile content

    Please see the rules and lines guidelines .

    Hello

    The people who answer questions here are for the most part, other users Firefox dedicating volunteer their time (like me), not employees of Mozilla or Firefox developers.

    If you want to leave a comment for the developers of Firefox, you can go to the Firefox help menu and select submit comments... or use this link. Your comments gets collected at http://input.mozilla.org/, where a team of people read it and collect data on the most common questions.

  • ODI 12 c: IKM for differential insert and update with a sequence in the target table

    Hello

    I have a map where I fill in a column of my target table using a database sequence. Now my mapping is supposed to load the target gradually table. So I need a revenge for update and incremental insert. Now with this differential IKM it compares all the columns to match all colmuns line to understand, it should be an insert or update. Now, the following code shows that when the ROW_WID is loaded with a sequence of database.

    If NOT EXISTS

    (select 1 from W_LOV_D T

    where T.ROW_WID = S.ROW_WID

    and ((T.CREATED_BY = S.CREATED_BY) or (T.CREATED_BY IS NULL and S.CREATED_BY IS NULL)) and

    ....

    ....

    < the rest of the comparison of columns >

    )

    So when running ODI returns following error

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "S". "" ROW_WID ": invalid identifier

    Please suggest if there is no other IKM I should use or if there is another way around it without changing the code IKM...

    Hi Marc,

    Thanks for your reply.

    I had solved it. The incremental update process inserts all rows from the source table to I$ table that exists in the target table. It does so by the where sql such as mentioned in my questions as

    WHERE THERE is NOT ( . COLUMNS = . COLUMNS)

    Now in the incremental update IKM Oracle to retrieve all the columns it uses the substitution with parameter as TABLE TARGET. Due to this column sequence will in the comparison and the request fails. When I used the IKM SQL incremental update it used INTEGRATION TABLE as parameter table to pick up the columns, as I'd mentioned in the target sequence is run, so it does not get the sequence column.

    Simple answer: to solve this, use incremental update of the SQL IKM.

    Thank you

    SM

  • Update with no link between the tables

    Hi all
    Let us, considering what follows in 11g:
    SQL> create table t1 (col1 number , col2 number);
     
    Table created
     
    SQL> create table t2 (col1 number, col2 number);
     
    Table created
     
    SQL> insert into t1 values(1,2);
     
    1 row inserted
     
    SQL> insert into t1 values(2,3);
     
    1 row inserted
     
    SQL> insert into t1 values(3,4);
     
    1 row inserted
     
    SQL> insert into t2 values(5,6);
     
    1 row inserted
     
    SQL> insert into t2 values(7,8);
     
    1 row inserted
     
    SQL> insert into t2 values(9,10);
     
    1 row inserted
     
    SQL> commit;
     
    Commit complete
    How can I update the table T2 col1 - column - with values of column in table T1 - col2? No order no required - just the values :)
    Maybe it's simple, but I can't get there...

    Thanks in advance,
    Alexander.
    select *
    from t1;
    
    COL1 COL2
    ---- ----
       1    2
       2    3
       3    4 
    
    select *
    from t2;
    
    COL1 COL2
    ---- ----
       5    6
       7    8
       9   10 
    
    merge into t2
    using (
     select *
     from ( select rowid rid,row_number() over(order by null) rn1
              from t2
            ) a,
           (
             select t1.*,row_number() over(order by null) rn2
             from t1
           ) b
     where a.rn1 = b.rn2
          )   x
    on (t2.rowid = x.rid)
    when matched then update set t2.col1 = x.col2;
    
    3 rows merged.
    
    select *
    from t2;
    
    COL1 COL2
    ---- ----
       2    6
       3    8
       4   10 
    

    Published by: JAC on November 5, 2012 18:36
    Amended or the requirement

  • problem with adujstments applied to the image after I click it to preview in Bridge

    I used the bridge to view my RAW images and open them in ACR for years... yesterday I downloaded a map full of images in a new folder on my computer and open as usual, bridge view.  For some reason any now when I'm in Filmstrip mode and I am interested in the large preview image, and then click on the preview of the image with the magnifying glass tool to display a small area, it seems to apply some sort of adjustment to the image.  My pictures you more light in the Center and more dark on the edges, almost like a spotlight/edge Center burn setting... and these changes are carriers through more cab when I open the image there.

    I checked to make sure that the automatic adjustment checkbox is unchecked in Bridge and ACR.  Everything in ACR seems to be to default settings.  I restarted my computer.  Don't know what to do, else, I am very frustrated!  Hoping someone here might have some ideas for me.  I'm under Bridge CS6 and PS CS6 with Camera Raw 8.1.  Thank you!

    It's so strange, because he has recently started to happen and I didn't modify parameters of any where... camera, bridge, ACR, or CS6.

    If something happens out of the blue a reset of the prefs would be an option (bridge of restart now pressed the CTRL key and choose Reset prefs in the menu).

    But here are a few observations of your screenshots:

    First, you set the option for thumbnails for 'embedded use' (you can see the Council left checker icon used for this parameter is selected). This means that the thumb of your al files show the preview jpeg generated from your DSLR camera, it is also confirmed by the black border showing around thumbs, which means that it only shows embedded. The moment that you select to display in the preview window, he begins to build a preview HQ and applies the default settings of RTAs, hence the difference between the embedded and the HQ preview.

    You can use the icon of Council right checker and select always HQ, this begins to build previews HQ for all files, takes some time, but after just as cached, you can easily scroll through all files without problem.

    Integrated thumbs (the originals of the camera) also show a beginning of vignetting. Not knowing not the quality of your goal, it seems to be a good but you use the measurement spot and full aperture at F2.8 lens and maximum zoom which could cause a bit of vignetting himself, when the ACR settings are applied a lot of contrast seems to be applied where more facts highlights vignetting and brighter.

    You should be aware that Adobe has chosen to use the default settings for each type of camera, but this does not mean that agree you with that

    There is always a way to settle in ACR by using different options such as exposure and contrast, etc by image or a series of on the same images.

    But you can also watch other tabs of the ACR settings window to create a personal preset of cab. The other with the curves icon has a few options to look at. To the point, you have a few options with different contrast settings, personally I use them, because I find a lot to fort, I put it to linear which gives it a much more neutral appearance (as said personal and I do most of my work in PS itself using adjustment layers and channel masks). If you check under the camera icon (calibration of the camera), you will find versions of various processes (2012 and especially 2010 are advised, 2012 is by default and has its advantages and disadvantages. More big difference is the way in which they handle highlights and shadows in the exposure tab).

    A second option to check is the profile of the camera itself with its different options. Here, I also checked the option neutral Adobe who seems a result of dull, but in the end he gives you the closest result of the original raw and a very good start for your personal result, just check all the other profiles one by one and select your choice. If you're happy save it as a new Camera Raw default with a proper name so you can always return to it in the presets window.

  • Displaying a value hidden with static text in the field "show text".

    Hello
    I've sifted through a lot of search results and could not find an answer, so I hope someone might be able to help.

    I have a hidden value that contains a date that I extracted from my database. I also have a "Show text" field shows that under certain conditions. I want to show the hidden value in my screen as text with another text field.

    For example, if the value of the hidden field is "10/11/09" I want to show a message that says "database was updated on 10/11/09".

    Advice on how to proceed would be appreciated!

    Thank you

    You can change the "Source" to "SQL query" Type and specify a query similar to

    Select "database update on | : The double HIDDENFIELDNAME

    CITY

  • I tried to update with windows and got the blue screen?

    Once the download is complete, I got the blue screen that makes the computer to restart. Once it reboots it works fine however in the lower corner
    to the right of the screen, I still see a yellow shield with black exclamation point saying "updates are ready for your computer" Please
    Click here for updates. The computer is a Windows XP and what I can do about it?

    Kind regards
    Ted

    Help us help you: start by reading this post 'sticky '...

    What information to post in the Windows Update forum
        http://answers.Microsoft.com/thread/1467f44b-ee27-4F7D-98d7-f1c4b35b3395

  • Apache manual updates can be applied to the ESX 4 Server?

    We use a product called retina to perform security analysis and she claims that Apache on servers ESX 4 (update 3) is a vulnerability and must be updated.  We can perform updates or it will cause issues with the services?

    Hello and welcome to the forums.

    In the "ESX 4 Patch Management Guide", he says in the FAQ:

    When a rpm on my ESX host has an equivalent Linux, can I use the Linux RPM to upgrade my system?
    N ° VMware recommends that you update your host ESX 4.0 with RPM provided by VMware.

    It is possible that the vulnerability has been also updated by VMware and an official patch is avaiable for her.

    Good luck!

  • How addons updated with new versions of the browser?

    Bookmark Favicon changer is a blockbuster addon. However, it does not work beyond FF v23.

    And there is no way to update this addon via Mozilla, even if the author has already written code to update FF v26.

    What is the formal process by which authors of 3rd party addon provide their updates to the official distribution of FF?

    Yes I think that mozilla developers are fully aware that a large part of firefox "success is due to its ecosystem of great addon.

    generally I have always perceived the devs to be very useful when it comes to these issues, and there are many resources for the authors of the addon (forum, documentation, articles, etc.) - however in this case it seems to be a fairly confrontational stage unfortunately (bug 834457).

  • Try to update with CC but get the message that I can't get to the Adobe servers?

    Hello

    someone has similar problems. There is no problem with my firewall settings and don't have 150 MB internet connection so no problem with speed. Maybe that's a problem with the Adobe servers.

    Hello

    Please see the following links:

    Re: Impossible to arrive on the Adobe servers, please check the firewall settings and try again

    Solve common problems of activation and deactivation of creative cloud.

    Also, try

    Let us know if that helps.

    Kind regards

    Bani

  • Update does not apply

    I'll pick up where Muppet152 left off... as I had the same problem with CC15.

    I am trying to open projects sent me another user CC15.

    Recap:

    First of all, the creative application Cloud says: I'm up-to-date on everything that's weird and wrong. I checked my first real (version9.0.0). It is not the latest (9.2). I have restarted CC, restarted my computer, always says that everything is up-to-date. I uninstalled the first and reinstalled. Still on the version 9.0.0.

    So, I went online myself and found the update patch 9.2 first released in January. However, try to install it gives me this error:

    ---

    Update failed

    Updates cannot be applied

    Please contact your administrator if you want to apply updates on your machine. Updates have been removed by the administrator.

    If problems persist, contact customer support for further assistance.

    ---

    I looked online forums and tried to change the AdobeUpdaterPrefs.dat file in/from the library. Still did not work. When I opened the first, it replaces just the .dat file and gray on the 'update' in the menu/Help option.

    I'm at square one, no solution in sight.

    Next, Jeff?

    Mac OSX 10.9.5

    CC2015 of first (version 9.0.0)

    Hi people.

    Thanks for the suggestions. I finally got.

    The bad step for me was that, in the Finder, I went Option + click for access/library. It gave me the option to/application Support/Adobe/AAM directoryUpdater /.

    When in fact, I need full admin access to see/Application Support / Adobe / AAMUpdaterInstaller /, which is where the .dat file should really be renamed. Once I have done that and restarted... Presto. CC desktop showed I needed 17 updates, first being one of them. I'm updating everything now...

    Just in time for the inevitable CC16 release? Da-dum-dum

Maybe you are looking for