How to read which item in a listbox is currently selected?

Is it possible to read which item in a listbox is currently selected?
I know how to tell what item in the list was double-clicked. I'd like to be able to click (once) on an item in the listbox and then use buttons on the front panel to affect the item(and list). For example, click on an item in the list and then click an "insert" button to add an item to the list before the selected one.
I'd like to be able to do this with both regular and multicolumn listboxes.

The value of the listbox is just a number for which row is currently selected. If you setup your listbox for 0 or more items or 1 or more items, then the value of the listbox is an array of I32 numbers showing which rows are selected. Use a property node to get the Item Names property (an array of the list items) and you can use the value(s) to index into the array. I have included a VI that I use to move items up and down in the list as well as delete items. Feed it the array of item names and the index for the line you want to move/delete. Then take the output and feed it back into a property node of item names.
I hope this helps.
Rob
Attachments:
Sequence_Element_Move.vi ‏37 KB

Similar Messages

  • SO Pricing User Exit - How to know which item is selected for re-pricing.

    Hello Experts,
    I have to modify material data when user does a update pricing in VA02, the problem is...How do I know which item is selected for re-pricing (in MV45AFZZ)? I am using user exit USEREXIT_PRICING_PREPARE_TKOMP.
    For Ex: If my order has 3 items and 2nd one is selected and then 'Update' is done on 'conditions' tab. Above pricing user exit is triggered 3 times for all items, so I cant check XVBAP.
    Your help will be appreciated.
    Thanks,
    Sagar

    Hi J@Y,
    Thanks for reply. But USEREXIT_PRICING_PREPARE_TKOMP is triggered for all items, so how do I know which is current item?
    If you see in debug mode, xvbap-posnr and tkomp-kposn will have 10,20,30 everytime (for 3 times). How do I know if user has selected 20?
    Thanks,
    Sagar

  • How to determine which item is currently in focus

    Is there a quick javascript way of determining which element on a page is currently in focus??

    You tend to complicate things :-)
    What you seem to want is: User is typing in some text field, clicks the Submit button, you would like the page to refresh and focus to return to the same text field so the user can continue typing as if nothing has happened?
    Then why do a traditional page submit? This seems like a perfect use for the AJAX stuff. Just do the stuff in the background instead of going thru all these hoops to save and restore focus.
    Also, it makes (some) sense for text fields, but what use does this feature provide for other input elements like checkboxes and radiogroups and select lists?
    What functionality are you trying to provide exactly?
    was just thinking about a quick and easy way of setting scrollbar position
    on page refreshYou mean having the page refresh and scroll down to some pre-determined point instead of at the top?
    This is best done by using named anchors. Just capture the item name that causes the page to submit in a hidden page item and add it to the same-page branch using the
    f?p=...#&P1_ANCHOR.syntax.
    Just sprinkle your region and label templates with these named anchors and you are done.
    Hope this helps.

  • How to read list item and display Title and on click hyperlink as value by javascript /jquery

    on newform.aspx just above the top of cancel button I want to put 1 hyperlink "Help"
    but I want to do this by script/jquery by reading my configuration list where 1 column is TITLE and other is- URL
    in TITLE column will write "Help" and in URL column  I will write
    http://portal1234/sites/sudha/MyHelppage.aspx
    so script should read Title and display Help--->1st part
    Script should read Value column and on click of help-(display link) the respective url should be open in new window.-->second part
    Please let me know reference code for adding anchor tag dynamically by reading from list
    I can see hyperlink near cancel button-
    $(document).ready(function(){
    var HelpLinkhtml ='<a href="#" text="Help">Help</a>';
    var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    now for reading from list I am trying below script-
    $(document).ready(function() {
        GetHelpLinkFromConfigList();
    function GetHelpLinkFromConfigList()
     //The Web Service method we are calling, to read list items we use 'GetListItems'
     var method = "GetListItems";
     //The display name of the list we are reading data from
     var list = "configurationList";
     //We need to identify the fields we want to return. In this instance, we want the Title,Value fields
     //from the Configuration List. You can see here that we are using the internal field names.
     var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Title' />"+"<FieldRef Name='Value' />"+"</ViewFields>";
     //comment
     var query = "<Query>" +
                            "<Where>" +
                                "<Neq>" +
                                    "<FieldRef Name='Title'/><Value Type='Text'>Help</Value>"
    +
                                "</Neq>" +
                            "</Where>" +
                            "<OrderBy>" +
                                "<FieldRef Name='Title'/>" +
                            "</OrderBy>" +
                        "</Query>";
     $().SPServices(
     operation: method,
        async: false,
        listName: list,
        CAMLViewFields: fieldsToRead,
        CAMLQuery: query,
        completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var displayname = ($(this).attr("ows_Title"));
        var UrlValue = ($(this).attr("ows_Value")).split(",")[0];
        AddRowToSharepointTable(displayname,UrlValue)
    function AddRowToSharepointTable(displayname,UrlValue)
        $("#NDRTable").append("<tr align='Middle'>" +
                                    "<td><a href='" +UrlValue+ "'>+displayname+</a></td>"
    +
                                   "</tr>");
    <table id="NDRTable"></table>
    Thanks :)
    sudhanshu sharma Do good and cast it into river :)

    Hi,
    From your description, you want to add a help link(read data from other list) into new form page.
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(AddHelpLink, "sp.js");
    function AddHelpLink() {
    var context = new SP.ClientContext.get_current();
    var list= context.get_web().get_lists().getByTitle("configurationList");
    var camlQuery= new SP.CamlQuery();
    camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Help</Value></Eq></Where></Query></View>");
    this.listItems = list.getItems(camlQuery);
    context.load(this.listItems,'Include(Title,URL)');
    context.executeQueryAsync(function(){
    var ListEnumerator = listItems.getEnumerator();
    while(ListEnumerator.moveNext())
    var currentItem = ListEnumerator.get_current();
    var title=currentItem.get_item("Title");
    var url=currentItem.get_item("URL").get_url();
    var HelpLinkhtml ='<a href="'+url+'">'+title+'</a>';
    $("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    },function(sender,args){
    alert(args.get_message());
    </script>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Item on the listbox cant be selected. PLS HELP.

    hello! i am a newbie to ABAP development.
    I followed the listbox steps stated on the RSDEMO_DROPDOWN_LISTBOX because I want to populate my listbox (I created from the screen painter) with the data from a table. It was successful and I can see the data now. Problem is when I am selecting an item of the listbox, it wont be selected. the only thing always selected is the first item on the listbox? what is happening? I do not understand. PLS HELP.
    big thanks.
    TYPE-POOLS: VRM.
    DATA: VALUE TYPE VRM_VALUES WITH HEADER LINE.
    DATA: DD1(20).
    DATA: INT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    SELECT * FROM SPFLI INTO TABLE INT_SPFLI.
    START-OF-SELECTION.
      SET SCREEN 100.
    MODULE PBO OUTPUT.
      LOOP AT INT_SPFLI.
        VALUE-TEXT = INT_SPFLI-CITYFROM.
        APPEND VALUE.
      ENDLOOP.
       CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
              ID     = 'DD1'
              VALUES = VALUE[].
    ENDMODULE.
    MODULE PAI INPUT.
      CASE SY-UCOMM.
        WHEN 'BTNEXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.

    <b>THIS IS A FOLLOW UP QUESTION.</b>
    I have listbox DD1 and I populated that with SPFLI-CITYFROM data. I used SELECT DISTINCT statement so that it will not repeat same entry on my list box. It was successful but then on the 2nd time and on the succeeding times you click on the listbox (trying to select other item), the listbox shows all the city entries from the SPFLI-CITYFROM. The SELECT DISTINCT takes effect only at first because as I have said on the 2nd and succeeding times you click the listbox, it will show you all entries of  SPFLI-CITYFROM. why is that? i dont understand.
    im sorry if i sound so dumb. im a newbie.<b> big thanks to all. </b>
    TYPE-POOLS: VRM.
    DATA: VALUE TYPE VRM_VALUES WITH HEADER LINE.
    DATA: DD1(20).
    DATA: INT_SPFLI TYPE STANDARD TABLE OF SPFLI WITH HEADER LINE.
    SELECT DISTINCT CITYFROM FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE INT_SPFLI.
    START-OF-SELECTION.
      SET SCREEN 100.
    MODULE PBO OUTPUT.
      LOOP AT INT_SPFLI.
        VALUE-KEY = INT_SPFLI-CITYFROM.
        APPEND VALUE.
      ENDLOOP.
       CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
              ID     = 'DD1'
              VALUES = VALUE[].
    ENDMODULE.
    MODULE PAI INPUT.
      CASE SY-UCOMM.
        WHEN 'BTNEXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.

  • How do I return to the start of the current selection?

    In Audtion 3 and earlier, if I wanted to hear currently selected audio, I just made the selection in the Waveform Editor, pressed Play and the selection would play.  It would play the same selection again if I stopped playback and pressed Play again.  In CS5.5 and 6 this only seems to work the first time you press Play after selecting some audio.  After that, the audio just resumes from when it last stopped.
    Is there any way to get the current time indicator to return to the beginning of a selection?
    Robert

    I find it to be quite consistent in its behaviour. But if you want to investigate the possibilities, go to Edit>Preferences>Playback, and you have several self-evident options to alter it.

  • URGENT: How to remove an Item from HTMLB listbox

    Hi All,
    I am designing a page, which contains a listbox, whose contents(items) need to be changed dynamically.
    I can populate it dynamically using
                   listbox.addItem(key, string)
    But, i don't see any specific methods to remove an item from it.
    Please Help Me in this Regard..
    vijay

    Hi Vijay,
    (a) every request on SDN is expected as urgent... If you won't use this word in the future, you'll have more time for solving your problems
    (b) If your listbox.getModel() returns the DefaultListModel, you can call removeItem(String key) on the model; see http://media.sdn.sap.com/javadocs/preNW04/SP2/60_sp2_javadocs/htmlb/com/sapportals/htmlb/DefaultListModel.html#removeItem(java.lang.String) for details
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • How to tell which items are in iTunes library on disc but not in program library?

    I made a mistake the other night and I deleted some items from my iTunes library ... but NOT from disc.
    These items are still in my 65 gig iTunes library on disc.  Somewhere.
    I'd like to re-add these songs.  Is there any way to tell which songs in the iTunes library on disc are not in the iTunes program library?
    I don't want to have to add all 65 gigs again and then remove all the duplicates
    thanks!

    You should try dragging some files already in the library into iTunes to see what happens. I just did, and the new iTunes 10.6 seems to be ignoring them. I then made a copy of a file already in the library, and I added both it and the original by dragging and dropping. Only the new file was added. There was no warning about duplicates in either test. So you may be able to drag your whole library back into iTunes.
    For when you do want to determine what files on disk aren't in the iTunes library or vice versa, here's one way to do it (if there's an easier way, I'm all ears):
    Export your library as a playlist to a text file.
    Use a program that can recursively list all your files on disk as full paths and save its output to a text file.
    Load the into a decent text editor. I use Notepad++. Then use a regexp search/replace to tidy up the files so that both consist of one fully qualified filename per line.
    Sort the files.
    Diff the files and examine the differences.
    I can do both 4 and 5 in Notepad++.

  • How can I edit items in a listbox?

    What I need to do is:  when the user clicks the 'edit' button, it should reference the listbox to ensure an item was selected.  So, if an item is selected, I need to store the item to a string variable. Next, the user should be able to use a textbox
    with a button to confirm the change, and a button to cancel the change.
    Thanks.

    OK, have you tried to do any of what you describe? If so, you can post your code here and describe what part(s) are not working for you.
    If you have not started yet, I suggest you read up on the ListBox class iterms collection and the methods available to manage that collection. Here are a couple of useful references:
    https://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.objectcollection%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
    https://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.items(v=vs.110).aspx
    If you're stuck, this simple example project I threw together may help you:
    https://onedrive.live.com/redir?resid=2E6335432DF7904B%2119080

  • How to read application item's value using  javascript

    Is there any way to read value of application item using javascript?
    Thanks

    Javascript can access the objects rendered for the page you are calling. This is why the $v function will do the work if calling it for a page item. However an application item isn't rendered on the page - the session state of it is only stored in the table. This is why you need to do it the way I described. You could do a workarround and create a hidden item on your page and compute the value of it using the application item value. Then you would be able to get the value of your application item using $v function.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • How to determine which CDockablePane in a group is currently active in Visual Studio 2013

    I understand that to activate a pane, I can do the following:
    dockablePane->ShowPane(TRUE, FALSE, TRUE);
    But, in a group of panes, how can I tell which pane is currently active?
    For instance, let's say there are 3 groups of panes on the screen.  The first group contains three tabs captioned "A", "B", and "C".  The second group contains "D", "E", and "F" and the
    third group contains "G", "H", and "I".
    How would I determine the active pane within each group?  (As an example for reference, within Visual Studio in the left pane group, I can currently see the contents of "Solution Explorer" while "Class View", "Property M...",
    "Resource Vi..." and "Team Explo..." are within the same group but not active.  In the bottom group, I can see the contents of "Output" while "Find Results 1" and "Find Results 2" are present but not active".  
    In the right group, I can see "MySource.cpp" while "MySource.h" is present but not active.  So, I need to know how to request from each pane whether they are the current tab within their container or not.
    Steve

    Hi Steve,
    Thanks for posting in MSDN forum.
    (As an example for reference, within Visual Studio in the left pane group, I can currently see the contents of "Solution Explorer" while "Class View", "Property M...", "Resource Vi..." and "Team Explo..."
    are within the same group but not active. In the bottom group, I can see the contents of "Output" while "Find Results 1" and "Find Results 2" are present but not active". In the right group, I can see "MySource.cpp"
    while "MySource.h" is present but not active. So, I need to know how to request from each pane whether they are the current tab within their container or not.
    This scenerio in your example, we don't need to know the current tab within which tab group. Actually I don't understand why do you need to know that? If you are using
    AFX_DOCK_TYPE::DT_SMART   model dock pane, the dock pane should be implemented in a internal MFC
    CSmartDockingManager
    class and it is not intended to be used directly from your code. . You could read the source code of this class at VS installed path-> VC->altmfc->src->mfc->afxsmartdockingmanage.cpp
    For the dock pane layout in VS interface, I remember there is a sample named Visual Studio Demo sample in Visual C++ 2008 Feature Pack. You can download it at here.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b4e6cb6e-e2a8-4e02-9c67-0dc431618157/visual-c-2008-feature-pack-samples-where-to-find?forum=vcgeneral
    And the dock pane control implements the core functionality that controls docking layout in a main frame window by CDockingManager class.
    https://msdn.microsoft.com/en-us/library/bb983791.aspx
    A greate article about using CDockablePane:
    http://www.codeproject.com/Articles/493218/Understanding-CDockablePane
    Please tell us more details about what you want to do.
    Best regards,
    Shu Hu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • 5s How to determine which version of operating system is currently installed

    How can I determine which version of the operating system is currently installed in my 5s without having to go to iTunes using my PC?

    Tap Settings > General > About.

  • How to read three parameters for exemple temperatur​e,current and voltage from the same port with visa read and separate them in a table

    Hi i want to read parameters with visa read, from three sensors related to  pic16f877a, using  module xbee ..but i want to make every one from those parameters (temperature, voltage and current) in a table ..it's the first time i use Labview so i don't know if ther is a solution for my problem so if any one have any idea please help me. thnx in advance. 

    [email protected] wrote:
    Hi i want to read parameters with visa read, from three sensors related to  pic16f877a, using  module xbee ..but i want to make every one from those parameters (temperature, voltage and current) in a table ..it's the first time i use Labview so i don't know if ther is a solution for my problem so if any one have any idea please help me. thnx in advance. 
    The short answer is: "Yes, of course."  But you are going to have to do the legwork and learn LabVIEW basics before we can offer meaningful help.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • How to tell which version of OBIEE I am currently using

    Hi,
    I am patching OBIEE on a server but no-one knows what version it is running. I can't seem to find the exact version anywhere. I know the release is 11.1.1.6 but that is all.
    Many thanks,
    Russell

    Login to Analytics/Answers preferably with the Administrator (generally weblogic) user and click on Administration. You should see the version on the top of the page.
    Hope this helps.

  • How can I make items visble and accessible if you select yes and not so if no?

    At current i am working on a form where you have a yes and no option if you select yes you must then select a level of risk low, med or high. I would like the items to only be able to be chosen if yes is selected.
    Please help!!
    Mustbeluck

    Your script is close, but it's in the wrong place.  You have it in the initialize event for cell E, so it will only execute once when the form is loaded up.  Place the following script in the layout:ready event of the JustifyE textfield (I used FormCalc for this one):
     if ( xfa.resolveNode("form1.#subform.Subform33.OtherSubform.AnimalNos.details.Total.Totals.Tot alE").rawValue > 0 ) then
    $.presence= "visible" 
    else
    $.presence= "hidden" 
    endif

Maybe you are looking for

  • XML from Final Cut Pro 7.0.2

    I have one single text clip in the FCP sequence to test this XML transfer. The text is centered. When imported into Premiere 6, the text is a different font and is up on the upper left corner. I have a credit sequence that I need to get into After Ef

  • Adobe Send within Acrobat XI Std - Integration with Outlook 2013

    I recently upgraded a user from Office 2007 to Office 2013.  The install for Office 2013 was a fresh install (not a true upgrade).  Prior to the upgrade, the user was able to use the Adobe Send feature within Acrobat XI Standard (11.0.10) to send doc

  • Ocassional slow start up with Preparing Windows message

    I have a new Toshiba C855D Satellite laptop that came with Windows 8. On about three ocassions now, when I turn on the computer to boot up, it takes a lot longer than usual... then eventually it shows the message "Preparing Windows." After that happe

  • BC Add-on for Dreamweaver CC 2014.1 not working - JS errors?

    I upgraded Dreamweaver yesterday to the new CC 2014.1 version, and it seems it's not compatible with the BC add-on (which I removed and reinstalled). It it gives a js error "BCModulePanel" on reSize not defined - the panel loads but doesn't connect t

  • Add package or class  to PL/SQL

    Hi, How can i add package or class when i used this in PL/SQL. where can i put the classpath for edu.sz..ie CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "MyApplication" AS import edu.sz.ie.*; import edu.sz.ie.bw.*; import java.util.List; import ja