Select items in a table dynamically

Hello...

I am writing a program where you can choose the elements of the array dynamically from the Panel when the VI is in run mode.

So far, that ic_opendevice.VI gives me different video formats [it is a 1 d array], at the moment, I guess as the penultimate among this table as an example. But, I want to design the program so that the user can select any Format of video of the façade. How to achieve this?

Block diagram:

Front panel:

Why you did not update in video format in the structure of the event?  You can use the 'video 2' Format: value change event.  Then, everything is in a single loop.

And you don't need to wait in your upper loop because the event structure will take care of your timing.

Tags: NI Software

Similar Questions

  • Get random items, no repetitive table

    Hello!

    I'm doing a 20-question, multiple-choice quiz. Each question is chosen at random in a table, and whenever the user clicks on the right answer, another random question comes up. I was not able to find a way to make sure not to repeat issues already selected. I tried to push the selected items in a table, then using $.grep and an if statement to check if the other randomly chosen question is already in the new table or not, but I couldn't get that to work.

    My code in the Panel of compositionReady is:

    var arr is ["Symbol_1", 'Symbol_2', 'Symbol_3', 'Symbol_4', 'Symbol_5', 'Symbol_6', 'Symbol_7', 'Symbol_8', 'Symbol_9', 'Symbol_10', 'Symbol_11', 'Symbol_12', 'Symbol_13', 'Symbol_14', 'Symbol_15', 'Symbol_16', 'Symbol_17', 'Symbol_18', 'Symbol_19', 'Symbol_20'];.

    sym.setVariable ("arr", arr);

    arr.sort (Function () {return 0.5 - Math.random ()});

    arr. Length = 20;

    var c = Math.floor (Math.random () * 100) %arr.length;

    for (i = 0; i < 20; i ++) {}

    SYM.$(arr[i]). Hide();

    SYM.$(arr[ques]). Show();

    };

    and whenever you click on the right answer, I run this:

    sym.getComposition () .getStage ().$("try_again1").hide ();

    sym.getComposition () .getStage ().$("correct1").show ();

    sym.getComposition () .getStage ().getSymbol("correct1").play ();

    var arr = sym.getComposition () .getStage () .getVariable ("arr");

    var c = Math.floor (Math.random () * 100) %arr.length;

    for (i = 0; i < = 20; i ++) {}

    sym.getComposition () .getStage ().$(arr[i]).hide ();

    sym.getComposition () .getStage ().$(arr[ques]).show ();

    }

    An overview of this would be much appreciated!


    Hi, bettiesac212-

    Well, I took a quick glance to your project (including project files was very useful, which is said by the way).  So what happens, is that you have included my code snippet in the middle of all the other things happening in your file.  There are a lot of questions I had looking at your code, like:

    • What is 'e '?  Where did this come from?
    • Why did you an array.sort initially?
    • Why do you attribute arr.length?  It is a property of arr already, so there is no reason to assign this

    Anyway, I cleaned up the code a bit to my snippet in.  I left some of her "as an exercise to the student", to paraphrase some of my old books, but I hope the console log will show you that usedArr is now a random picture that you can save.  If you save a variable that has the index, (aka "what question am I on?"), then you can get where you are now, add one, save this variable and are looking for the next item in usedArr and know that it is properly randomized.

    For those who are looking for an answer, this is the code I ended up using:

    var usedArr = new Array();

    var currentIndex = 0;

    While (currentIndex< 20)="">

    var randNum is Math.floor ((Math.random () * 100)) % 20;.

    If (usedArr [randNum] == undefined) {}

    We can place an object!

    usedArr [randNum] = arr [currentIndex];

    currentIndex ++;

    }

    by do not increment the currentIndex, we force basically he draw again

    }

    for (i = 0; i< usedarr.length;="" i++)="">

    Console.log ("index usedArr" + i + ":" + usedArr [i]);

    }

    You can save your new table and just browse each time

    you say "next question."

    I think that's more or less what I posted in my previous answer.  Bettie, I'll send you a link to your project files via private message in a few minutes.

    Thank you

    -Elaine

  • How to select the next item in a table view?

    Hey,.
    I want to select the next item, but I have no idea about it? have you any suggestions?
    for example:
    the second element is currently selected, I need to select the third in my code, how can I implement this feature?
    private IntegerProperty index = new SimpleIntegerProperty();
    
        public final double getIndex() {
            return index.get();
        }
    
        public final void setIndex(Integer value) {
            index.set(value);
        }
    
        public IntegerProperty indexProperty() {
            return index;
        }
    

    Get the selected item:

    table.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
    
                @Override
                public void changed(ObservableValue observable, Object oldvalue, Object newValue) {
                    Person selectedPerson = (Person) newValue;
                    setIndex(data.indexOf(newValue));
    
                }
            });
    

    Select the following index:

    table.getSelectionModel().select(index.get() +1  );
    
  • Custom code to return all the selected items in a dynamic list

    Does anyone know of a custom code to return all the selected items in a dynamic list? Support told me that Dreamweaver does not return the last item. If anyone can give me a Tips how make this code custom or can direct me to code, I would be eternally grateful.

    Thanks to you two. I used the square brackets since they are in this season...

    No,

  • How to hide a multiple selection of the TableRegion element dynamically

    Hi all

    I have a requirement to hide the column multipleselection area of table dynamically. Based on the id liability multipleselection column must be disabled or hide.

    I gave the following code to set the fake rendered property.

    OATableBean tabBean = (OATableBean) webBean.findIndexedChildRecursive ("SearchTable");
    Salt of OAMultipleSelectionBean = (OAMultipleSelectionBean) tabBean.getTableSelection ();

    sel.setRendered (false);

    But it's not working. Someone help me in this.

    Thank you and best regards,

    Myvizhi

    Hello

    Try using the code below:

    (I found this on the blog of Mukul

    Oracle of Mukul technology blog: dynamically change multiselect for single select statement in table of the OAF)

    Hide Multiple selection

    OAAdvancedTableBean tabBean = (OAAdvancedTableBean) webBean.findIndexedChildRecursive ("[table item id]");

    Given that multiple selection is at the end, get the total-1 to remove

    int count = tabBean.getIndexedChildCount (pageContext.getRenderingContext ());

    System.out.println ("number of children" + count);

    tabBean.removeIndexedChild(count-1);

    Sushant-

  • To access the selected items in a ListBox control

    In LabVIEW 2010, I have a ListBox control. How can I get a list of the objects that the user selected in the ListBox?

    I don't see any method, property or event that would provide this information.

    Thank you.

    The value of the ListBox are the indexes of the selected items.

    If you allow the user to select "0 or more' items, the data type will change in a table."

    To get the names of the selected items (I guess that is what you want), you should India property 'element names.

    Tone

  • need selected item in the shuttle to the impact of my request

    Hello can some guide.

    I have an element of the shuttle where I will be selected some selections.  .

    Now once I need the value for a query...

    and who has to drive into my list in my procedure.

    So, let me show you an example

    create a procedure test (mlist in varchar2)

    Declare cursor c1 is select * currency whose name in mlist.

    Start

    for xxx in c1

    loop

    Warn (xxx. (Name)

    end loop;

    end;

    The code above will not work cause if I give test ('USDOLLAR', 'EURO') because it addresses separated as an argument.

    I need to send it in the form of a .array table but the value of the selected item looks like this

    USDOLLAR:UKPOUND:INR

    so, how can I send this value as the parameter for the query

    But in the apex.

    Replace your query with something like this:

    Select * from currency where INSTR (': ' | mlist |) ':',  ':' || name | ':') > 0

    Sergio

  • Determine the index of the selected items in a ListBox?

    Hello

    I can't find a simple/direct method to determine the index of the selected item in a list box.

    I feel I'm missing something, but I can't seem to figure out who (if any) returns an index number if you use it with the recall of .onChange for a ListBox control.

    The following code implements that I need, but is not particularly efficient or elegant and can get confused if you introduce multiple lists to check.

    Any suggestions to reproduce this behavior, even with the best code would be appreciated.

    Thank you!

    var RES = ' palette {text: 'Example-list' properties: {resizable: true}-} ".

    NLP: Panel {orientation: 'row', preferredSize: [400 600]------}

    list1: ListBox {preferredSize: [400 550], properties: {multiselect: true, numberOfColumns:2, showHeaders:true, columnTitles: ["list 1", "item 0"]}}, \

    }}"

    var win = new Window (res)

    Win.Show)

    for (i = 0; i < 10; i ++) {}

    var line = win.pnl.list1.add ("point", "Same entry")

    row.subItems [0] .text = ' paragraph '+ i}.

    Win.PNL.List1.OnChange = function() {}

    var tempArray = new Array()

    for (i = 0; i < win.pnl.list1.items.length; i ++) {}

    If (win.pnl.list1.items [i] .selected == true) {tempArray.push (i)}

    }

    selectedRow = win.pnl.list1.items var [tempArray [0]] .text

    var selectedRowSubitem = win.pnl.list1.items [tempArray [0]] .subItems [0]

    Alert ("selection:" + tempArray + "\n posted content:" + selectedRow + "\t" + selectedRowSubitem)

    }

    .. .in the same time, that should be enough

    win.pnl.list1.onChange = function() {
         alert(this.selection.index); // for this to work set, multiselect:false
    }
    

    I guess you already tried and the result is 'undefined', the reason is that you have this property

    multiselect:true
    

    in this case, the selection returns an array

    this.selection[0].index;
    

    I'd give you the first selected item, even if you only have a single element selected, for all selected items to loop through all the elements in the selection table.

    not sure if the wonderful guide Peter explains this (explained in the Guide to the tools), but you should read it too, he has tons of info.

  • Outline around the selected items of OCD

    WebHelp. RH9

    I just installed IE9 and when I run my published WebHelp and select a link in the table of contents, it displays an image dotted around the selected item. This never happened with IE8, so I was wondering if there is anyway to prevent it? Is it possible to add a "outline: no ' somewhere in the RoboHelp output (as you would in styling a CSS link) so that it does not appear?

    Thank you very much

    Jonathan

    Hi Jonathan,.

    Unfortunately, IE was a nut that is more difficult to crack than I imagined. The problem is that IE9 supports the css schema, but the table of contents is running in mode of whims so no goodness IE9 it... There is a solution, it's just not as easy as I thought. See http://www.wvanweelden.eu/robohelp/modifying_webhelp/remove_outline_in_toc for a step by step guide to get rid of the sketch.

    Note: If you let me, I would use your example on my site image. It seems much better than the image for example, I added

    Take a bow

    Willam

  • Rename the name of the table dynamically in a loop

    Hi all

    It might not be the best solution, but it is a starting point for me. I have tables: x1_old, x2_old... x1_new, x2_new...
    When I receive new tables, it's x 1, x 2... You need 3 things:
    1 x1_old, x2_old must be removed
    2 x1_new, x2_new must be renamed to x1_old, x2_old
    3 x 1, x 2 tables can be renamed to x1_new, x2_new.

    I hope this makes sense.

    I managed to drop the tables dynamically(step 1). But impossible to apply a similar approach to rename (step 2 and 3).

    Following the code gives an error: ORA-00900: invalid SQL statement

    DECLARE
    x NVARCHAR2 (50): = ";
    y NVARCHAR2 (50): = ";
    BEGIN

    -Rename tables ending in 'NEW' for 'OLD '.
    FOR x IN (SELECT table_name
    From all_tables
    Owner WHERE to = "OWNER_X."
    AND SUBSTR (table_name,-3) = 'NEW')
    LOOP
    y: = SUBSTR (x.table_name, 1, INSTR (x.table_name, 'NEW') - 1) | 'OLD ';
    EXECUTE IMMEDIATE 'Rename ' | x.table_name | « à » || y;
    END LOOP;
    END;
    /

    I read that I can't use DOF with Execute imeediate. No work around? Or different approach?

    Thank you

    I had where you went wrong.

    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2  x NVARCHAR2(50) := '';
      3  y NVARCHAR2(50) := '';
      4  BEGIN
      5  --Rename tables that end with 'NEW' to 'OLD'
      6  FOR x IN (SELECT table_name
      7  FROM all_tables
      8  WHERE owner = 'HR'
      9  AND SUBSTR(table_name, -3) = 'OLD')
     10  LOOP
     11  y := SUBSTR(x.table_name, 1, INSTR(x.table_name, 'OLD') - 1) || 'NEW';
     12  dbms_output.put_line('ALTER TABLE ' || x.table_name || ' rename to ' || y);
     13  EXECUTE IMMEDIATE 'ALTER TABLE ' || x.table_name || ' rename to ' || y;
     14  END LOOP;
     15* END;
    SQL> /
    ALTER TABLE X1_OLD rename to X1_NEW
    DECLARE
    *
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at line 13
    

    Now updated the code

    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2  x VARCHAR2(50) := '';
      3  y VARCHAR2(50) := '';
      4  BEGIN
      5  --Rename tables that end with 'NEW' to 'OLD'
      6  FOR x IN (SELECT table_name
      7  FROM all_tables
      8  WHERE owner = 'HR'
      9  AND SUBSTR(table_name, -3) = 'OLD')
     10  LOOP
     11  y := SUBSTR(x.table_name, 1, INSTR(x.table_name, 'OLD') - 1) || 'NEW';
     12  dbms_output.put_line('ALTER TABLE ' || x.table_name || ' rename to ' || y);
     13  EXECUTE IMMEDIATE 'ALTER TABLE ' || x.table_name || ' rename to ' || y;
     14  END LOOP;
     15* END;
    SQL> /
    ALTER TABLE X1_OLD rename to X1_NEW
    ALTER TABLE B_OLD rename to B_NEW
    ALTER TABLE A_OLD rename to A_NEW
    
    PL/SQL procedure successfully completed.
    
  • selected item is not currently available

    Some of the videos - everything (with NBC News) cannot be seen:

    "The selected item is not currently available.

    El Capitan 10.11.6, Safari.

    At the same time, that these videos are available at the same place using Chrome Firefox for mac.

    It's NBC or Safari?

    Luke

    Most likely Safari...

    Part of the problem may be due to cookies from Safari.

    Go to Safari > Preferences then select the Privacy tab, then click on remove all data from the Web site and exit then restart Safari.

    If this does not help, you may need to update Flash.

    Open system preferences > Flash Player > updates > check now

  • Cannot select items from menu top 25% of the window of the browser most of the time.

    Running Windows 7 Pro, on a new HP Ultrabook (2 months) with FF 15.0.1. Several times, selectable items work not, but usually in the 20-30% of the browser window. With the pointer hovering over selections, it does not change to indicate a selectable element, or if it will allow you to select. It happens on sites such as Yahoo!, HP, etc. He doesn't do it all the time, but I'd say at least 50% of the time, even if you reload the page and allow all sites with NoScript. There is no warning of filtering.

    You are welcome.

    Please let us know the name of the extension of the problem because it helps others.

  • Cant' import images of Photos because "it is not enough free space on the volume of your library to import the selected items.

    Hey guys,.

    So I tried to import some ~ 8 GB of photos on my mac, but the Photos app gives me the following message: "there isn't enough free space on the volume of your library to import the selected items. It is estimated that you need at least X.XX GB of additional free space. »

    Where X.XX represents the amount of GB it says that I need but it changes everytime that I reopen the application to attempt an import.

    My mac has currently 44.4 GB so I don't know why this issue is coming.

    Any help would be great!

    Thanks in advance,

    Andres

    Where is your library?  If it's on an external HD and how the drive is formatted?

    Have you tried to repair the library according to this document from Apple: library of your repair?

    What version of PHotos do you use?

  • Get rid of the black borders around the selected items?

    My granddaughter of thirteen months was interested in my keyboard and now each selected item has a black frame to highlight... and there is a small sign at the bottom left of the screen showing what I typed just, by providing the keystrokes, etc..

    What is and how to turn everything off?

    Thank you!

    ED in Brooklyn

    System preferences/accessibility/voice off - turn off the power. Command - F5 works also.

  • How can I determine which item in a table was just clicked on?

    I have a table set in place on my front. When user right click on an item in this table, I would like to be able choose among 3 different options. I have the shortcut menu works, but I need to know what element of the array of the user in a click with the right button to determine what values to change. How can I get the index of the item?

    Thanks for any help!

    https://decibel.NI.com/content/docs/doc-6406

Maybe you are looking for