Problem with text NULL with DataGrid SelectedItems

Hello

I need to create a string based on the name property to the rows in a DataGrid.

Here is my code:

get the names of devices

var idx:uint;

var len:uint = dg.selectedItems.length;

var deviceNames:String;

for (idx = 0; idx < len; idx ++) {}

deviceNames += dg.selectedItems [idx] ['name'] m:System.NET.SocketAddress.ToString () + ",";

}

Whenever I have trace or display the string deviceNames, there "null" in the beginning, like this:

"nullDevice1, Device2.

Why null appears? I tried to remove it, replace and nothing.

I know you can use replace or concat, but none of those who work. There are only two rows in my datagrid. I don't know why NULL is even appearing at the beginning of the string. I changed the dimensions of the loop, because I thought that maybe it wasn't in zero-based, but still no luck.

Hello

you do not have assinged any value of type string to variable, so it is show null.

Write like this...

var deviceNames:String = "";

It works perfectly. Let me know if you have any problem.

with respect,

Mayeul Singh Bartwal

Tags: Flex

Similar Questions

  • [help] Problem with datagrid and DB

    Hello

    I have a problem with my flex2 app.
    EDIT: happens in all not only in firefox browser

    I use one
    < mx:HTTPService id = "userRequest4" url = "DB.php" useProxy = "false" method = "POST" > "
    < mx:request xmlns = "" >
    < / mx:request >
    < / mx:HTTPService >

    to send a request to a php script what data back to the database, and these data are load in a datagrid in this form:

    < mx:DataGrid id = "dg" width = "100%" height = "100%" dataProvider = "{userRequest4.lastResult.pathis.Product}" editable = "true" itemEditEnd = "getCellInfo (event); ">
    < mx:columns >
    < mx:DataGridColumn dataField = "ID" headerText = "ID" editable = "false" / >
    < mx:DataGridColumn dataField = "number" headerText = "Name" / >
    < mx:DataGridColumn dataField = "price" headerText = "Price" / >
    < mx:DataGridColumn dataField = "S" headerText = "S" / >
    < mx:DataGridColumn dataField = "M" headerText = "M" / >
    < mx:DataGridColumn dataField = "L" headerText = "L" / >
    < mx:DataGridColumn dataField = "XL" headerText = "XL" / >
    < mx:DataGridColumn dataField = "XXL" headerText = "XXL" / >
    < mx:DataGridColumn dataField = "other" headerText = "Other" / >
    < / mx:columns >
    < / mx:DataGrid >

    EDH, I call the php script, when someone clik in the menu option:
    private void menuHandler(event:MenuEvent):void {}
    if(Event.Item.@label=='Manage Product') {}
    Add_Products.visible = false;
    Add_Products.width = 0;
    Add_Products.height = 0;
    Add_design. Visible = false
    Manage_Products.width = 500;
    Manage_Products.height = 500;
    Manage_Products.Visible = true;
    Add_design. Width = 0;
    Add_design. Height = 0;
    userRequest4.url = "MP.php";
    userRequest4.send ();

    }
    }

    and this function updates the DB when the cell is changed:

    private void getCellInfo(event:DataGridEvent):void {}
    var myEditor:TextInput =
    TextInput (event.currentTarget.itemEditorInstance);
    Get the new value of the Publisher.
    var newVal:String = myEditor.text;
    var objN = new Object();
    objN.ids = dg.selectedItem.ids;
    objN.dato = newVal;
    objN.fields = event.dataField;
    userRequest2.url = "UP.php";
    userRequest2.send (objN);
    }

    and have the property to change the cell, and when that happens to update the database, it worked perfectly, no problems, but when to charge datagrid (I send the request to the DB.php) show this value have cells before that have edited :/
    you know a way to fix it?
    If someone knows please help me, I have urgent need of this :D

    Kind regards
    Shadow.

    try to add dummy prameter to your url in the httpservice which will force the browser not to cache xml

    for exempla, you can add '? blabla = "+ {new Date () .milliseconds}"

  • Problem with DataGrid scroll... Does not fit in the Parent container...

    Hi all

    I have a module and module contains only a datagrid. I add this module to dynamically navigation tab in the next index. I use Text as a converter of item in the DataGrid, and the row height will change according to the diplyed of the text data. When the data fill in datagrid datagrid beyond layout containers. That is, height is not suitable in the parent container. I use the canvas as parent container... Please find below the attached photos and you will get to know what is my problem?

    problem.jpg

    problem2.jpg

    Please, help me out of this problem... It is urgent...

    I don't know what your code looks like, so it is difficult to say what exactly

    It is.

    It may be that you do not assign minHeight = '0' on the DataGrid control.

    Validation code a simple test case will help us to understand what is wrong.

  • ItemRenderer problem with DataGrid and label

    <mx:DataGrid width="100%" height="100%" rowCount="5" dataProvider="{publish_status}">
         <mx:columns>
              <mx:DataGridColumn dataField="status" headerText="Status">
                   <mx:itemRenderer>                         
                        <fx:Component>
                             <mx:Label text="{data.status}" fontSize="12">
                                  <fx:Script>
                                       <![CDATA[
                                       override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
    
                                       super.updateDisplayList(unscaledWidth, unscaledHeight);
                                       
                                       if(this.text == "A"){
                                            setStyle("color", "blue");
                                       }                              
                                       else if(this.text == "B"){
                                                 setStyle("color", "green");
                                       }
                                       else if(this.text == "C"){
                                            setStyle("color", "red");
                                       }
                                       else{
                                            setStyle("color","white");
                                       }
    
                                       }
                                       ]]>
                                  </fx:Script>
                             </mx:Label>                                             
                        </fx:Component>                              
                   </mx:itemRenderer>
              </mx:DataGridColumn>
         </mx:columns>
    </mx:DataGrid>
    

    I created an ItemRenderer online as described above. I understand that it is recycled and have included the last "else" statement to return the color by default if all tests fail.  The problem is that the text still appears in bad colors.  I did a lot of reading on the forums but I can't understand what Miss me.


    Thank you.


    BTW, I am using Flash Builder 4.

    Try changing the color in a dataChange event place in a

    override updateDisplayList.

  • I can't access some websites using Firefox. For my own site, I get "file not found". My Yahoo downloads in the form of text. No problems with browsers IE or Chrome

    I can't access some websites using Firefox. Pages say "File not found" or in the case of Yahoo and Facebook, they resemble the on-screen text files. No problems with my computer and it is not the case with my browsers IE and Chrome. Already deleted and reinstalled Firefox and it has not solved the problem

    You can also do a check of malware with some digitization programs of malicious software on the Windows computer.

    Please scan with all programs, because each program detects a different malicious program.

    All of these programs have free versions.

    Make sure that you update each program to get the latest version of their databases before scanning.

    Alternatively, you can write a check for an infection rootkit TDSSKiller.

    See also:

  • a text box is every moment that I edited dynamically scroll bar upward. I know that's not a problem with the Web site because she works with other browsers

    There is a problem with scrolling of a text box bar. whenever it is changed dynamically developing area moves upward instead to keep the focus in the area of the new inserted text. even if I move it down to hand it back again.

    OK, I have fixed the code in my program. When I finished the editing, I use this code in javascript.
    document.getElementById("chatMainTxt").scrollTop = document.getElementById ("chatMainTxt") .scrollHeight;

  • Is anyone having problems with their 6 s new more not to send and receive images through text messages unless your cell data are lit?  Even if I'm on wifi, I won't get it the pic unless the cell data is on?

    Is a person with problems with their new 6s more iPhone send and receive pictures via SMS?  Even if I'm on WIFI, I have my cellular data button turned to receive a picture. Then in turn instead to use WIFI, it devours my data plan. If to halfway through the month I get warnings that my data plan has almost disappeared. I did everything, including resetting the phone to factory settings. It also does not send a text if IMessage is turned on. It switches immediately to Imessaging which of course, again use my data plan. Of course, I could use some help with this. BTW, my text messaging service is connected to my phone number and not my email. Who was one of the suggestions that support Apple told me to check. Never in my life have had so many problems with a phone since I bought this iphone 6 s.

    Mgibson2425 wrote:

    Is a person with problems with their new 6s more iPhone send and receive pictures via SMS?  Even if I'm on WIFI, I have my cellular data button turned to receive a picture. Then in turn instead to use WIFI, it devours my data plan. If to halfway through the month I get warnings that my data plan has almost disappeared. I did everything, including resetting the phone to factory settings. It also does not send a text if IMessage is turned on. It switches immediately to Imessaging which of course, again use my data plan. Of course, I could use some help with this. BTW, my text messaging service is connected to my phone number and not my email. Who was one of the suggestions that support Apple told me to check. Never in my life have had so many problems with a phone since I bought this iphone 6 s.

    SMS is a function of the carrier, you will need to contact your cell phone provider and see what is the matter.

    IMessage uses very little data.

  • Just recently, I receive the following error message when you try to access the web sites. I get a pop-up window indicating "Exc in ev handl: TypeError: c.location is null" then I have to click ok. There is a problem with some plugin?

    Just recently, I receive the following error message when you try to access the web sites. I use Firefox browser version 10.0.2. I get a pop-up window indicating "Exc in ev handl: TypeError: c.location is null" as the web site page is displayed in the browser winder. So, I have to click ok. Any link/website I go to what happens. There is a problem with some plugin?

    It is only a problem for the SiteAdvisor users who are still on 3.4. This problem is resolved in the latest version of SiteAdvisor, which is 3.4.1.195. Go to http://siteadvisor.com and click on download. This will fix the problem.

    Meanwhile, SiteAdvisor team will push down a JS update in the coming days 1-2 to automatically resolve this problem in version 3.4.

  • I just bought an IPhone 6 Plus. When I get a text Message I get no advice or vibrations. I have all the settings correct. I know many others with the same problem with this phone. Any suggestions?

    I have just purchased IPhone 6 Plus. When I get a text Message I get no notification - no vibration and no noise. I put everything correctly. I know several others who have the same problems with this phone. Any suggestions?

    I have the same problem. You own an iPhone 6 Plus 2/9. Problems began the next day. Phone took over and got another new. Problems with another brand new! Volume is also impoverished - even when up until the end. Extremely frustrated! Any advice would be appreciated.

  • Problem with some values in the round of text

    Hello

    I have a problem with the control of the "ring of text.

    In my software, I need to update the values of ring of text, using a property node. But some values are not included by the ring of text, even if they are defined inside.

    I agree with you an illustration of my problem and the piece of code that does not work, I hope you can help me

    Thank you

    Julie

    Probably a result of the fact that the floating point numbers cannot represent exactly every real number.  Up to 0.4 is not exactly equal to 1e6 4th-7 x.

  • I have problems with your e-mail via a web client is sending no text in the body and sending HTML instead of text.

    I have problems with your e-mail via a web client is sending no text in the body and sending HTML instead of text.  I am told that this problem is because of the BING toolbar on my browser - is this correct?

    original title: Messaging with the BING toolbar problem

    I suggest blind carbon copy yourself e-mails coming out in the future to check for other errors and if they happen then find a new Web hosting provider.  They should have been aware of the conflicts, one would presume.

    Steve

  • Problem with an application of text analysis

    Hello

    I am a beginner in labview and I have some problems with my application.

    I have the front of my VI, an area of input text and two arrays of strings: one that contains a few words I have to say if they can be found in the text.

    And the other table contains the results of research: found or not found

    I did my version of the block diagram (I have attached to it), but I noticed that it only works only the first time I run the VI, subsequently, it displays the same results despite the entry of text or words. I find the my table has continued to add new entries every time that my for loop runs so I try to reset the table with constant strings at the beginning, but I guess that I did not it properly because I have the same problem.

    And I also have another problem: my array of words has its size = 7 and if I fill it with fewer words it's size, empty boxes in the results table appear as noted.

    Can anyone gve me a suggestion?

    The first attached VI is my original request where I found the problems described and the second contains what I have tried to correct

    Autoindexing if your friend here (and MUCH simpler because of things).

    Also know that "offset after match" will be-1 if the word was not found.  So you can just do a simple check for the number being greater than or equal to 0 see if it has been found.

  • BlackBerry Z10 text message problem with BlackBerry Z10 - insulation, inadmissible, not shipping

    Having a few texts from major problems.  Sometimes when I touch on a contact, I send SMS it takes about 20-30 seconds for the key board and the cursor to arrive.  When you type, it takes 20-30 seconds for the next typing.  When I finally have the ready message, it will take 30 to 60 seconds to send... or I get an alert "failed to save the message.  I rebooted and tried to take the battery off-don't... no luck.

    This problem occurred intermittently for the last few months, but sometimes for an hour or two.  Currently, it has been almost 24 hours.  I'm getting very, very tired of these problems with this phone.  I've been a BB user for 7 years and will visit with someone else I'm frustrated that.

    However, my BBM works very well.

    Hello

    So, she was always like that? Or is this new behavior? If new, what happened just before the behavior started? An update of a certain type? A new application? Physically removed or damaged? Something else?

    Also, sometimes the OS itself just is damaged and a clean OS refill can be useful for troubleshooting problems.

    Official methods, which will be controlled as to what exact OS versions are available:

    Non-official methods, which are cleaner and allow you to choose a version of the OS that maybe your carrier (or anyone they control your offers) delays in approval:

    Of course, before you start this, you want a good backup link, a manual copy of the memory of your device to your PC and complete documentation of your configuration (identification information of account, adding applications, configurations, etc.). Sometimes, restoring a backup returns unit corruption even, must be eliminated and reconfiguration from scratch can solve that.

    Be aware of the risks of 10.3.2 however... There are two things to worry about. First of all, be 100% sure that you know your BBID identifiers... If you do not, you may make your useless device to anyone, including yourself. Second, once you move to 10.3.2, you cannot fall back to 10.3.1 or earlier, by any medium (for example, even the unofficial AutoLoaders can not overcome this restriction anti-secours).

    Good luck!

  • Problem with text input.

    Hello.

    I have problem with input text boxes / text fields. In the text fields of the text cursor (line) just stops flashing. If you start to type, it does not show the text you type in unless minimize you and maximize the window. This happens in many programs.

    For example, office 2013:

    ^

    Type the text. Cursor does not move and it does not have the blink event as it should.

    ^

    Reduce and optimize the Word then, now the typed text is visible.

    This also happens in Chrome too. If you type something in, the text box does not update, but the drop down menu suggestions only. I have no idea why it does.

    Can someone help me please?

    Thanks for reading.

    It is usually a video driver issue.  At the office, you might be able to alleviate the problem by disabling the settings video hardware acceleration.

    Although I would like to ask when this problem started for you, because that might help identify the real causes and lead to a better solution.

  • I have a problem with the cursor jumps when entering text.

    Original title: cursor jumping when entering text

    I use Microsoft 7 and the cursor keeps jumping when I type. This causes the text to be misplaced. Some answers I've seen only direct you to the hardware options but never directly any specific solution. Grateful for ideas?

    Hey Joe,

    Thanks to join Microsoft Community where you will find all the required information on the Windows operating systems!

    The problem may occur due to the speed of the pointer mouse inappropriate or if the sensitivity of the touchpad is too high.

    To help you better, we need more information.

    What is brand and model computer?

    To work with the issue, I suggest you follow these steps:

    Method 1: Hardware store

     

    Open the hardware and devices Troubleshooter

    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

    Method 2: Update mouse drivers

     

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

     

    Method 3:

     

    Change the settings of the mouse pointer.

     

     

    Refer to section to change the mouse pointer works on the site:

    Change the settings of the mouse

    http://Windows.Microsoft.com/en-in/Windows7/change-mouse-settings

    Method 4:

    If you use a laptop, change the sensitivity of the touchpad.

    See solving problems with your touchpad in more options in the site:

     

    Mouse, touchpad and keyboard with Windows problems

    http://Windows.Microsoft.com/en-in/Windows/help/Mouse-touchpad-and-keyboard-problems-in-Windows

     

    I hope this helps. If the problem persists, or if you have problems of Windows in the future, let us know and we would be happy to help you.

Maybe you are looking for

  • Water damaged ipod data recovery

    So my apple ipod touch 5th generation dipped in a pool (always check your pockets at the back) and unresponsive. Since then the screen is black and the ipod won't even turn on. It has been like that for 5 days, and I already skipped all the water. Is

  • Satellite L670-12J - becomes inadmissible constantly

    Hello My Satellite L670-12J new running Windows 7 64 bit freezes constantly, usually a few minutes after the start of almost every time I turn it on. It becomes inadmissible: I can't change the application, view the Task Manager or activate the start

  • I can't load android in hp touchpad

    I can't load android in hp touchpad

  • Initial setup of TouchPad: device will not power on!

    This morning I received my new 32 gb WiFi HP TouchPad by mail. I opened the content and began to charge the device. following the quick start guide. When I plugged my charger microUSB button began flashing (alternating left and right). Then I went to

  • Admin, but the items are grayed

    I just upgraded to Win 7.  I have not configured all users, so I'm administrator.  Many items are grayed out.  For example: Advanced - tab printer properties all items are grayed out.  I want to update the driver for my printer and I would like to pr