Arrays, and Dataproviders

Right then my app made things difficult to enter data in a drop-down list item and I'm stuck so I would ask kindly for support.

The code that gets the info is:

var stLinkUrls:URLVariables = new URLVariables(evt.target.data);
dpp = stLinkUrls.stbbapi_links.split(",");

Code that is further down in the code that displays the drop-down list is the following:

var dp:DropDown= new DropDown();
dp.rowHeight = 45;
dp.rowCount=3;
dp.width = 250;
for(var i in dpp){
    dpp.push({label:"http://tncr.ws/"+i.toString()});
}
dp.dataProvider = new DataProvider(dpp);
addChild(dp);

The variables url gets its info from my server from a php page which has 2 variables "URL" you can see an example of the output of my php page if you like here: http://tncr.ws/example_beta5.php?apiv=110&key=23f452fae5943d0b5e059b3e5a71e097&s=http: / / www.nickdodd...

Hey nick,

Alrite so I got it to work. a few things that you need to change in your output from the Web server. to separate URLVariables, you will have to insert '&' between the two, a bit like a query string in your url in the browser bar. second thing you want to do is instead of use "\n" to separate your link ID and real URL, use the bar rather ' |. ' (just above the Enter key on most keyboards - might have to hit the shift). Here is a link to a page with the correct URLVariable string that you should be using my suggestions:

http://www.rabcore.com/workshop/PlayBook/variableTest.php

so after getting to look like that, to analyze you have to take a few steps. first of all, you need to obtain raw data first and then split with commas like you did. then you take that and further break down to separate your URL and link ID's then you add to the dataprovider and implemented. Here's some code that shows you how to do exactly that:

URLLoaderTest.as:

package{    import flash.display.Sprite;    import flash.display.StageAlign;    import flash.display.StageScaleMode;    import flash.events.Event;    import flash.net.URLLoader;    import flash.net.URLRequest;    import flash.net.URLVariables;

    import qnx.ui.data.DataProvider;    import qnx.ui.listClasses.DropDown;

    [SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]    public class URLLoaderTest extends Sprite    {        /**         * make all variables accessible throughout the          * application         *          */

        private var loader:URLLoader;        private var request:URLRequest;

        private var dropDown:DropDown;        private var dpp:Array;        private var dataProvider:DataProvider;

        public function URLLoaderTest()        {            super();

            // support autoOrients            stage.align = StageAlign.TOP_LEFT;            stage.scaleMode = StageScaleMode.NO_SCALE;

            /**             *              * Use the loader class to load your URL with the correct              * URLVariable string             *              */

            request = new URLRequest("http://www.rabcore.com/workshop/playbook/variableTest.php");

            loader = new URLLoader();            loader.load(request);            loader.addEventListener(Event.COMPLETE, handleData);

        }        private function handleData(e:Event):void        {            var stLinkUrls:URLVariables = new URLVariables(e.target.data);

            /**             *              * First round of parsing the data retreived from the server             *              */

            var stLinkUrls_parsed:Array = stLinkUrls.stbbapi_links.split(",");

            /**             * Now that have an array of URL with their link ID's             * we pass it to the to the setupDropDown() method             *              */

            setupDropDown(stLinkUrls_parsed);

        }

        private function setupDropDown(arr:Array):void        {            dpp = new Array();

            /**             * Here is where the money is. you iterate through your             * array of links.             */

            for each (var linkData:String in arr)            {                /**                 *  now remember that they are in the [ID]|[link] format.                 *  so we have to further seperate it to keep the ID and                  *  link seperate. we then store it in a new object that                  *  we can just push into the drop down array.                 *                  */                var linkDataObj:Object = new Object();

                /** split the links at the "|" */                var linkDataArray:Array = linkData.split("|");

                /**                 * since the ID is first and the URL is second in the split,                 * we can just append http://tncr.ws/ to the beginning                  * and save the actual url to the "url" portion of the                  * object we are adding                 *                  */

                linkDataObj.label = "http://tncr.ws/" + linkDataArray[0];                linkDataObj.url = linkDataArray[1];

                /** push it into the drop down array */

                dpp.push(linkDataObj);            }

            /** now we just set the drop down up */

            dataProvider = new DataProvider(dpp);

            dropDown = new DropDown();            dropDown.dataProvider = dataProvider;            dropDown.width = 400;            dropDown.rowCount = 5;            dropDown.setPosition(10,10);

            addChild(dropDown);

        }    }}

I left comments throughout that should walk you through it. hope that sheds some light on the issue. Good luck!

EDIT: corrected the code to reflect your original display code.

Tags: BlackBerry Developers

Similar Questions

  • "The String to Byte Array" and its operations on-site (memory) of twins "Byte Array to string"? (or if they incur sentence of copy/memory operation?)

    I can't deduct the answer to this question (topic/post title) of the help of LabVIEW on the functions.

    Intuitively, it seems that the two representations of data are equal to the memory and so goes between the two should essentially be a no-op when the code is compiled... but is it? (assuming that the length of the array of strings/remains constant, can I go back repeatedly without performance?)

    As a string of LabVIEW is a handful and any other type of data except tables aren't a handful; that implies to me that a string = U8-table-grip handle and so a string into an array of U8-could be a memory or inefficient operation since no conversion actually take place?

    The reason I ask, is that when you work with for example TCP Read or read VISA, 'data' reading is always a string, but according to what you are doing, this string is often more efficiently processed/interpreted if converted to an array of U8 and I just want to know if (memory and CPU point of view) I can move freely between the chain and U8 array and return depending on what format is most appropriate to a point?

    (Also, I'm at this stage fairly certain that the "array of strings of bytes" is cleaner AND more efficient than a type-cast to an array of U8 strin... but I could be wrong.)

    I did some tests on this just now, and my conclusion is that it is completely in place. The local users group had a coding challenge when this became relevant to my solution.

  • Best way to transfer strings, arrays and clusters

    Hi, I just want to know the best way to transfer strings, arrays and clusters between a PC and a computer-RT (compactRIO) if I want to use them in deterministic loops:

    For a string should I use a published network shared variable flow or network?

    For an array of doubles should I flatten the array in a string and the string of transfer? or should I send it as a picture?

    The same for clusters, should I flatten the cluster or the transfer as a cluster?

    Thank you!

    Transfers on the network are not deterministic.  You ask how to use the data in a deterministic way, once it arrives on the RT system.  Usually, you would create a separate loop, not critics of time to deal with network communications.  The data arrives it is copied in real-time-safe structures such as RT-FIFO to put at the disposal of the evanescent loop.

    I can't give you specific advice on network variables and network flows; Finally, I did this kind of transfer over TCP, until these other options were available.

  • Upadate elements of an array and reuse them

    Hi all

    I have a problem with the update of the elements of an array and use these items again. Well, I have the clearer idea. I have a one-dimensional array of double. Now I'm just comparing two adjacent elements. If the difference is greater than a threshold, I need to update all other elements (for example, add 100 with all the remaining items). Then repeat the whole things until all elements are compared.  I tried the following. But I'm not sure how to use the updated table "Method 2" instead of "method 1" in the following loop. ' " In Place element Structure"has not helped.

    I know it's pretty simple in C++, where we can use the reference to the table. I'm new in labview and don't know how to do it here in labview.

    Looking for your help.

    BR.

    Rosen

    Have you tried just using the tool 'unwrap the phase"?

  • How can I do 1 d array and pointer to place an acquired image?

    How to make a 1 d table and create a pointer to the first position to put an image in?  I thought that's what I did (see picture) but continue to get an error of 1097, probably due to the incorrect memory allocation.  I have the size of the image in bytes and a string, will call a dll and am pretty sure that is not what is causing me problems.  However, the pData is supposed to be a pointer to the first element of a 1 d table which is the width in pixels * height.  I read on the website of LV table of the image I did look like a 2D array, but is actually a 1 d array and that the pixel pointer points to the first element of the array.  Is it not the case?  Thank you.


  • I would like to migrate from Aperture. What happens to my masters that are on a RAID array and then what should I do with my safe which is located on a separate drive please?

    I'm sorry, but I'm loud understand what happening to my master original RAW files, I keep offline on a RAID array and then what I do with my safe that, like all my photos modified? Sorry for this simple question, but would someone help please my lift the fog?

    Thank you

    Rob

    One of the major downfalls of Aperture is that it shows you where are your pictures. They always favored it as a feature (even as a ' new paradigm'), but it's not so wonderful when you need to do something about Apple never intended. Then, it sounds really like it led to you not knowing where your files or files that correspond to which elements of the UI opening. I suggest that you need to nail for yourself - images from Aperture to right click and choose Show in Finder, until you know where everything is.

    Otherwise, make sure you have plenty of available disk space, stop asking questions and just see what happens when you run plugin import LR with the options I suggested. It won't damage the opening.

  • Difference between an associative array and Nested table

    Hello

    Can you please tell me, what is the main differences between associative array and Nested table. I'm not sure, in this case we are to use.

    Thank you and best regards,
    Sanjeev.

    user13483989 wrote:
    Hello

    Can you please tell me, what is the main differences between associative array and Nested table. I'm not sure, in this case we are to use.

    Did you happen to read the documentation, explain its good enough!
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25519/composites.htm#LNPLS005

    Aman...

  • What is the difference between associative arrays and nested tables?

    Hello
    What is the difference between associative arrays and nested tables?

    nested tables cannot be indexed by other than pls_integer and unlike nested tables table associative cananot be declared at the schema level.

    is there any other difference set apart from the diff above 2?

    user13710379 wrote:
    What is the difference between associative arrays and nested tables?

    Name-value pairs (associative) against a list of values (table standard/nested table).

    nested tables cannot be indexed by other than pls_integer

    They are not "indexed" the way in which an associative array is indexed. A standard table is referenced by the position of the cell in the table. This position is essentially the offset of the memory of the cell from the start address of the table.

    Can not solve a cell in an associative array directly via a memory offset index. You place a cell reference value it by his 'name' (a search in the linked list/hash table).

    The following example shows the difference between the pairs of name / value and a list of core values.

    SQL> declare
      2          --// associative arrays are NAME-VALUE pairs
      3          type TArr1 is table of varchar2(10) index by pls_integer;
      4          type TArr2 is table of varchar2(10) index by varchar2(10);
      5
      6          arr1    TArr1;
      7          arr2    TArr2;
      8  begin
      9          arr1(100) := '1st entry';
     10          arr1(1) := '2nd entry';
     11          arr1(5) := '3rd entry';
     12
     13          arr2('john') := 'New York';
     14          arr2('jane') := 'Paris';
     15          arr2('jack') := 'London';
     16
     17  end;
     18  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL>
    SQL> declare
      2          --// standard arrays are lists
      3          type TArr3 is table of varchar2(10);
      4          type TArr4 is table of number;
      5
      6          arr3    TArr3;
      7          arr4    TArr4;
      8  begin
      9          arr3 := new TArr3( '1st entry', '2nd entry', '3rd entry' );
     10
     11          arr4 := new TArr4( 100, 1, 5 );
     12  end;
     13  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • Down, enjoy a 2D array and the average of the two numbers

    the problem: first Coloum (A) 6635 elements, the 0.15 to 30 one-step 0.0045, second coloum (B) random numbers of DBL.

    Down in the a sample of linear to 30 points (1-30)

    Take the average of the two data points in B that correspond to the upper and lower each step limit.

    a link below illustrates well the im data works with.

    ex: (A, 189) = 0,996 (B, 189) = 29,83

    (A, 190) = 1.0005 (B, 190) = 34.41

    (ONE, 412) = 1.9995 (B, 412) = 17.13

    (ONE, 413) = 2.004 (B, 413) = 14.88

    This would be the first point in the new array (A, 1) = 1 B, 1 = 32.12

    and the second point would be (A, 2) = 2 B, 2 = 16.005

    The only whole number has is 30, and its value in B will be used

    How would sort the table to find these values, without the use of 60 search for items?

    and once you find the item, tell him to recover the data in the next coloum?

    Once it is towards math nodes or node formula will end the vi.

    Thanks for any help

    BESIS


  • Match entries in an array to another array and create a new table.

    I tried for a while to do what should be a simple operation.  I have some of my code work exectpt for this part, which is similar to the post below.

    http://forums.NI.com/T5/LabVIEW/pulling-out-values-from-a-1d-array-based-on-look-up-table/m-p/404524

    However I try to match the first two columns in table 1 to those in table 2 and create table 3.

    Please can someone help?  I'm in a time crunch.  Thanks in advance.

    Same idea, another implementation using variants to perform the search.

  • 2D Array output confusion - arrays and loops

    Hello

    I am writing a program for a measure 3-terminal of a FET.

    I use 2 power supplies: for every increase of grid voltage Vg, I'm doing a drain voltage Vd Sweep and save the Id and Vd.

    The attached code, you'll see a Subvi, called "I.V. 2 terminals", which returns a table of voltage Drain (1 d) and a table current Drain (1 d).

    But because the output of the Subvi is in a loop (For increment Vg), the end result is a 2D array.

    Whenever a table is leaving a loop it acquires a dimension.

    So ultimately I don't know what are the clues. How can I prevent the table to have a dimension of their out of the loop For?

    I would like to see the output of the Subvi to go straight out of the loop, intact.

    I have attached the Subvi as well, but I don't think that you will need.

    Thank you! I'm still very new to LabVIEW and I really appreciate your help.

    Nicolas

    You can disable autoindexing on any tunnel by clicking right, with evidence that cause you only get data from the last iteration. Is what you want?

  • Excel & ActiveX: Insert arbitrary columns of 2D array and create problems of graph

    Hello

    I want to insert data in a 2D of LabView or 1 d table in Excel and create graphics.

    I used the information in the following example:

    http://www.NI.com/example/28934/en/

    and has managed to create a new Excel file (I use Excel 2010) writes data in a 1 d table to a column in excellent by creating a while loop and using the first element of the array to write in a specific cell. I use the loop counter to write to the next cell when the loop starts again and always remove the first value, I write to the cell of the table until it is empty.

    Now I also want to write a 2D - column in Excel table should be the first column of the matrix and so. Here, I can not use the loop counter directly as Excel there are only 1,2,... for the lines, but uses A, B,... to count columns. Also I do not know in advance the number of columns my 2D array will contain, thus creating a lookup table as (A means 1, 2 B, which means...) is not really an option (except there is really no other way). Is there a possibility to convert numbers into letters or somehow to "explain" to the program that this column 2 of the table means column B in Excel for example, or is it possible to insert new columns?

    I figured out how to add new calculation sheets and as I also need to create a certain number of spreadsheets and I know that the standards 3 sheets are present during the creation of the file, I use the method 'Add' to create new worksheets before the worksheet 3 - I could use the same method to create new columns in Excel , but so far I have not found a method to do. Or is there a way to enter into the 2D table all at once?

    So I want to create a chart (in case 1 d tables draw a bar when using 2D arrays a 3D field) to display the data. I found this example:

    http://www.NI.com/newsletter/51339/en/

    -> that I do not have the tool box I would do it directly using ActiveX, so I tried to make things as shown under the title "ActiveX DIY /.» NET'

    I tried to load the code snippet into a new Excel file but got the error message "microsoft.office.interop.excel.dll" not found and this is why the code does not work. Which confuses me a bit as I guess when this dll is not present I can not access Excel of LabView at all, although my understanding of what I'm doing so far is limited in the calm. ;-)

    Also - as far as I understand the extract - when you create a new graphic object, I should be able methods to create for her, however when I do a right click on the graphic object to a symbol of the spreadsheet ActiveX it no listed.

    To explain my problems better, I added an excerpt showing my two problems: the inside of the two loops while showing how to import a table 1 d. In the outer loop I separate the columns. I know that is not currently as has all the data in the column of the Excel sheet - so I need to convert the external meter number a, B,... or find another solution.

    In addition, on extract, I placed a property ActiveX spreadsheet with the Chart object - I can see that the difference to the graphics object of the example code of the last link above is the color. However I do not know what it means and how to change / fix this.

    And just to make sure - I know that this path that the VI is not running as the graphical object is placed completely false – I just did, so it is included in the extract.

    I would be grateful for any suggestion,

    Thank you!

    Hi all

    for your information in professional 2014 LabVIEW report generation toolkit is included

    Table 2D

    I want to write table 2D in specific columns/rows in excel

    Graph

    Create a graph through ActiveX Labview traced XY scatter on an excel sheet

    also good information about Excel and ActiveX

    Excel Council

    Hope that if aid, if not please let me know.

  • How can I combine a string array and an array of integers?

    I have an array of string data [to use as header] and an entire table of multiple column vakues; I need them together in a single file.

    Am not able to combine so that I could write them in a single file.

    There are several ways you can do.  What I recommend is:

    1. Open the file
    2. Use the table to a spreadsheet string to transform your headers into a single string
    3. Write it to the file.
    4. Use the table to a spreadsheet string to transform your digital data in a single string
    5. Write it to the file.
    6. Close the file
  • Search for data in a 2d array and trigger a signal when it is recognized

    Hi, I'm looking for an interactive way to find data in a table that contains a 2d array in a cluster. Data in table 2d. I have attached the vi containing the table. I want an interactive method to search for the codes of the 2d table (found in the 1st row) and once found a signal to say it was found. The signal varies in what category data code has been found (if engineering, law or other). BTW the I'm looking are in fact data entry using a barcode reader. Use a table 1 d search function? or is there another method?

    Just to make sure that we are clear here.  We try to find the cluster that contains a point of data in the first row of the table 2D?

  • Need help with the data storage store, local array and network connections

    Need help with my ESXi 4.1 installation

    My hardware:

    I built a server with an Asus P6T whitebox, i7 920, 12 Gig RAM, NIC, Intel Pro1000 PT Quad, 3ware 9650SE-12ML with 8 1.5 TB SATA green in a raid 6 array gives me about 8 + TB with a spare drive all housed within a NORCO RPC-4220 4U Rackmount Server chassis.  I also have a 500 GB SATA drive which will hold the ESXi and virtual machines.

    The network includes a firewall, Netgear Prosafe FVS336G, GS724Tv of Netgear ProSafe 24 port Gigabit Managed Switch on a dhcp cable modem internet service provider.

    I also have 2 old NetGear SC101T NAS disks (4to) I want to connect to the system how some - at a later date have... data on them and want to transfer to the new storage array. I always looking into the question of whether they will work with ESXi 4.1, or I might have to only access it through Windows XP.

    My Situation:

    I have already installed ESXi 4.1 and vsphere client with no problems and it is connected to a dhcp cable internet service.  I've set up host via a dynamic DNS service name give me a static hostname on the internet.  I installed three machines to virtual OS successfully at the moment and now want to first start by creating a multimedia storage server which will use some of this new 8 TB array, then separate data storage for use with a web server small overhead storage and a backup.  It is a domestic installation.

    Help with the data store and network:

    I was doing some reading, because I'm new to this, and it looks like I'll probably want to set up my table via ESXi as a nfs disk format.  Now, the data store is usually in another physical box from what I understand, but I put my readers and ESXi all in the same box.  I'm not sure that the best way to put in place with grouped network cards, but I want to make this work.

    I understand that in ESXi 4.1 using iSCSi LUN must be less than 2 TB, but nfs - I should be able to add a bigger partition then 2 TB (for my multimedia) in nfs, right? or should I still add it separately as a separate 2 TB drives and then extend them to get the biggest space.

    Any suggestions or direct resources showing examples on how to actually add some parts of the table as data warehouses separate nfs.  I know that to go to the configuration tab, and then select Add to storage, and then select nfs. I have not my picture, but it's here that I don't know what to do because ESXi 4.1 system already has an address, should I put the same thing to the new data store array also (will it work?), and what should I use for the name of the folder and the store of data... just do something to the top.  I thought to later install Openfiler (for a multimedia storage using this table server) as a virtual machine, use the table with esxi so that I can access the same storage space with widows and linux-based systems.

    I also know I have to find a way to better use my quad nic card... put in place of virtual switches, grouping, etc HELP?

    Any direction, assistance, similar facilities to sample, suggestions or resources that would help would be great. I did a lot of hunting, but still a little confused on how to best to put in place.

    You must think of VMDK files of large databases with records of random size guest go read some data (a DLL or an INI file), maybe write some data back, then go read other data. Some files are tiny, but certain DLLs are several megabytes. It's random i/o all and heavy on the search time. IO Opsys is small random operations that are often sequential (go read data, write data, go read other data,...) so that deadlines are critical to the overall performance. That's why people say OPS are / s of reference and forget the MBs flow. The only time where you bulk transfers are when you read media (ISO files).

    Well, now forget all this. Actually the disk activity will depend on the specific applications (database? mail server? machines compiler?), but the above is true for boots, and whenever applications are idle. You should see the profile to know.

    RAID 10 is faster (and often more reliable) than RAID 5 or RAID-6 except in certain specific cases. In General RAID 10 is ideal for many random writes, since the calculation of parity for RAID-5 and - 6 adds to the overall latency between command and response - latency is cumulative if a little slow here and a little slow it adds up to a lot of overall slow synchronous especially with e/s on a network. OTOH RAID-5 and -6 can produce faster readings due to the number of heads, so you can use it for virtual machines that transfer bulk. Test. You may find that you need several different types subdashboards for best results.

    You said 3ware, they have some good grades on their site, but don't believe it. With my 9650 that I found myself with only a couple of their recommendations-, I put the (simple) table for allocation size 256 k, nr_requests at 2 x the queue_depth and use the planner date limit. I had the habit for the Ext4 file system formatted with stride and stripe-width synced to the table and used the options large_files with fewer inodes (do not use the huge_files option unless you plan to have single VMDK files in the terabyte range). Use a cache of great reading in advance.

    Virtual machines use VMDK files in all cases except raw iSCSI LUN that they treat native disks. VMDK is easier to manage - you can make a backup by copying the file, you can move it to a PC and load it into another flavour of VMware, etc. There could be some features iSCSI to your San as a transparent migration but nothing for me. NFS has less chatter of Protocol if latency lower times to complete an operation. NFS is good to read and write a block of data, that's all it boils down to.

    UPS is good, but it won't help if something inside the machine explodes (UPS does nothing if the PC power supply goes down). If the RAID card has an option for a battery backup module, so it can contain some writings in memory and may end up the disk i/o after replacing the power supply. 3ware also limits the types of caching available if help is not installed, and you get just the right numbers with the module.

Maybe you are looking for