Can you select a specific item from a listbox via scripting?

This seems like it should be easy, but I've spent quite a few hours trying to figure this out, to no avail.  I'm trying to create a button that would automatically select a specific item on a listbox.  I though "selectedIndex" would do the trick, but this seems to only work if the user actually selects a specific item on a listbox.  I'm looking for the opposite effect, where a person will push a button where a specific item on the listbox gets selected.
Any help would be much appreciated...thanks!

You can use the setItemState method for this purpose.
To select the third item use:
ListBox.setItemState(2, 1);

Similar Messages

  • How: can i get a specificated item from a list with more than 100.000 items

    Hi,
    i have a very large list and i got always an exception that the list has more than 5000 items and cant query!! But in the default list view i can see, order and filter all items. So how can i do this by c#?

    Hi,
    According to your description, my understanding is that you want to get a specific list item form a list which with more than 100000 items using C#.
    I suggest you can use CAML Query with some condition and set Row Limit to specify the number of items to return.
    Here is a detailed code demo for your reference:
    Client Object Model Access Large Lists/Overcome ListView Threshold while accessing large list
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Can you block a specific person from imessage

    I have someone blocked every way but iMessage.  I don't want to turn it off, can they be blocked?

    If they are sending SMS text messages via the cellular network, some carriers allow blocking specific source phone numbers.
    If it is iMessage to iMessage similar to instant messaging, then the best I can suggest is creating a contact for this user and configure the text tone to None and the vibrate to None, so you will not notice when these messages arrive.
    You can do something similar for unwanted phone calls, but you would have to download and install a Silent ringtone, but once you do that you do not get interrupted by unwanted calls. Google will find free Silent ringtones
    You can even attach multiple phone numbers and email addresses to a single contact so you do not need to create multiple contacts. My contact is call "Junk Call" and when I get a new junk call I associate it with that contact and after that I do not hear the calls. And my missed calls list shows the call as "Junk Call". They do not waste my time, and I'm happy

  • HT4528 how can you select 1 photo from a shared photo stream and save it to your HD

    Can you select a single photo from a shared photo stream that some had sent me as I want to save and print the family photo?

    FAQ photo stream http://support.apple.com/kb/HT4486

  • How do I removing a specific item from an Array?

    Hi there.
    I am having an array of movieclips and when my circle(controlled with the keyboard) hitTests true with one of the movieclips inside that array i want to remove that movieclip from the array so when i hitTest it again it returns false (I hitTest using a "for in" with that array).
    How do i remove a specific item from within an array?
    Can someone help me? Thanks a lot.

    i haven't noticed anyone showing deference because of the points.  in fact, i've seen some people (a minority, to be sure) be just obnoxious about it.  i never encountered that before:  some people feel they have power because they can dole out points.
    but overall i agree with you:  the loss of the list of threads i am participating in, along with the most recent posters name, is a significant drawback of the new forums.  and there's nothing new in these forums that offsets that drawback.
    in addition, i think we've lost way more than 1/2 the older threads.  that's a lot of information that's no longer available.

  • HT3702 How can you remove a credit card from your account?

    How can you remove a credit card from itunes account?

    See if this support document answers your question. Why can’t I select None when I edit my Apple ID payment information? - Apple Support

  • I can´t remove win from my mac because I can´t select the remove option from boot camp assist. Can anybody help me?

    I can´t remove windows partition from my mac because I´can´t select the remove option from boot camp assit. Can any body help me?

    open disc utility choose the drive you need partitioning highlight the bootcamp partition and click on the minus sign at the bottom left.
    after this manually resize your drive by dragging the partition line all the way down and click on partition.

  • Can you download a rental movie from itune and move to an external drive

    How can I export an itune movie to an external drive?
    If I can download a rental movie and move to an external drive?

    Hi Niel.  Can you be move specific for those of us not tech savy?   1 - Can you provide steps to back up the library?  2 - How do you organize the library?  3 - When you move the entire iTunes folder, does it include iTunes paid for music along with downloaded music from CDs?  Thanks

  • Can you stitch digital TIFFs taken from all sides of the object into a 3D image in CS-6

    Can you stitch digital TIFFs taken from all sides of the object into a 3d image in CS-6

    It depends on the object. The mesh must have surfaces (texture names) for each side of that object. Then an image can be applied to each side.
    Photoshop currently lacks a way to select a side and give it a name.
    You may want to try a program like blender to assign surfaces to a mesh. It is a very robust and daunting program, but its free and if you have the time maybe worth your while to learn it.

  • Can you intercept an Oracle error from a "Process Row" process?

    Hi,
    Can you intercept an Oracle error from a "Process Row" process?
    Example:
    I have been just creating a validation process to check if I'm about to insert a duplicate record so I can give the user a "User friendly" error message.
    It would be awesome if in the error message you can select "PL/SQL function returning result" and have it pass it to the Notification area..
    I doubt there is a way but I thought I would ask..

    >
    I think everyone is waiting for a better exception-handling, but even 4.0 won't bring any improvements in this area.This is kind of what bugged me about 4.0. I feel that they put more effort into making it cool and flashy and ignored some pretty basic core issues like error handling. I mean sure the new jquery powered application builder is nice, but your users never see that - they do however see you not being able to hook into the error handling. There are several issues that have lingered for years that keep getting passed over for other things - i mean the Forms conversion release was such a waste in my opinion. They could have used that release to fix some bugs.
    Of course thats my 2 cents.

  • Can you have two detail lists from the basic list at the same time?

    Hi
    Can you have two detail lists from the basic list at the same time?
    If yes how and if no why?
    Thanks
    Venkat

    No   ... it is not   possible   of   2 detail  list at   one time   from the basic  list ...
    you can  increament   the SY-LSIND  .... But you can not   display  both the windows   at single time  ...
    it is  possible  to  display  2 Detail list  in ALV   ......  from one  basic  list   using  the  Blocked  list  concept    .
    Sample Program on BLOCK LISTS
    Report   zblock_list
    * Declarations for BLOCK ALV DISPLAY
    *--type pools
    TYPE-POOLS:slis.
    DATA:x_layout TYPE slis_layout_alv,
    t_field TYPE slis_t_fieldcat_alv,
    *--field catalog
    x_fldcat LIKE LINE OF t_field,
    *--to hold all the events
    t_events TYPE slis_t_event,
    x_events TYPE slis_alv_event,
    t_sort TYPE slis_t_sortinfo_alv,
    x_sort LIKE LINE OF t_sort ,
    *--Print Layout
    x_print_layout TYPE slis_print_alv.
    *----Macro to add field catalog.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    DEFINE add_catalog.
    clear x_fldcat.
    x_fldcat-fieldname = &1.
    x_fldcat-seltext_m = &2.
    x_fldcat-outputlen = &3.
    x_fldcat-tech = &4.
    x_fldcat-col_pos = &5.
    x_fldcat-no_zero = 'X'.
    x_fldcat-ddictxt = 'M'.
    x_fldcat-datatype = &6.
    x_fldcat-ddic_outputlen = &7.
    if &6 = 'N'.
    x_fldcat-lzero = 'X'.
    endif.
    *--build field catalog
    append x_fldcat to t_field.
    END-OF-DEFINITION.
    *----- data declerations.
    data: v_repid like sy-repid.
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    ernam like mara-ernam,
    meins like mara-meins,
    end of itab.
    data: begin of jtab occurs 0,
    matnr like makt-matnr,
    maktx like makt-maktx,
    end of jtab.
    select matnr ernam meins
    up to 20 rows
    from mara
    into table itab.
    select matnr maktx
    up to 20 rows
    from makt
    into table jtab.
    v_repid = sy-repid.
    *DISPLAY alv
    * Initialize Block
    call function 'REUSE_ALV_BLOCK_LIST_INIT'
    exporting
    i_callback_program = v_repid.
    *Block 1:
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '18' '' '1' 'C' '18',
    'ERNAM' 'Created By' '12' '' '2' 'C' '12',
    'MEINS' 'Unit' '5' '' '3' 'C' '3'.
    *--build table for events.
    x_events-form = 'TOP_OF_LIST1'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
    exporting
    is_layout = x_layout
    it_fieldcat = t_field
    i_tabname = 'ITAB'
    it_events = t_events
    it_sort = t_sort
    tables
    t_outtab = itab
    exceptions
    program_error = 1
    maximum_of_appends_reached = 2
    others = 3.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *--BLOCK 2(SUMMARY REPORT)
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '20' '' '1' 'C' '18',
    'MAKTX' 'Description' '40' '' '2' 'C' '40'.
    *--build table for events.
    x_events-form = 'TOP_OF_LIST2'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    * Append table block.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
    exporting
    is_layout = x_layout
    it_fieldcat = t_field
    i_tabname = 'JTAB'
    it_events = t_events
    tables
    t_outtab = jtab
    exceptions
    program_error = 1
    maximum_of_appends_reached = 2
    others = 3.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *--CALL FM TO DISPLAY THE BLOCK REPORT.
    call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    * exporting
    * is_print = x_print_layout
    exceptions
    program_error = 1
    others = 2.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    form top_of_list1.
    skip 1.
    write: 10 'List 1',
    /5 '--------------------'.
    skip 1.
    format reset.
    endform.
    form top_of_list2.
    skip 1.
    write: 10 'List 2',
    /5 '--------------------'.
    skip 1.
    format reset.
    endform.
    reward  points if it is  usefull ....
    Girish

  • Can you take the SIM card from an IPad and transfer it to a NEW Ipad (not yet purchased) without any problems? Are there any complicated steps involved? Thanks.

    Can you take the SIM card from an IPad and transfer it to a NEW Ipad (not yet purchased) without any problems? Are there any complicated steps involved? This is for my boss.
    Please let me know. Thanks in advance.

    Simple answer is YES.
    The only caviat is for instance in the UK some iPads are locked to a specific network provider and therefore if the new iPad is locked then it will only work on the specific network it is locked to.

  • How do you recall a deleted item from Notes icon?

    How do you recall a deleted item from Notes icon?

    You can't.  The only way to get a note back is to perform a restore from a backup, which involves wiping the device and downloading a backup from itunes or icloud.

  • HT2500 Can you categorize archives by date, from or to as you can in outlook?

    Can you categorize archives by date, from or to as you can in outlook? My question actually pertains to Imac but is the same issue on all platforms.

    First we need to sort out what platforum are you using?
    mac, iPhone, ipad
    What version of the OS are you using?
    What app areyou running?
    How about a screen image of the archive you are using?
    How to show us a screen image.  Avoid personal identification.
    command + shift + 3   Will take entire screen.  You hear a click.
    command + shift + 4 Lets you decide what to take.  Mouse pointer changes. Move mouse to upper left corner of desire image.  Hold down left mouse key where to start image.  Drag mouse to lower left of where you want to stop image.  Release mouse.
    You will get a picture n.png file on the desktop.
    one the forum input panel you will see the camera icon.
    click on camera icon.
    another window will appear.
    Make sure you have selected the from your computer tab.
    click on Browse button
    An open file panel appears.  Select the file.
    After selection a file, I have this screen showing.
    You will have to click on Insert Image.  You may have to scroll down to see Insert Image button.

  • ADF 11g can not select and copy data from cell of readonly table in IE

    hi,
    In ADF 11g, when render view object as readonly table with Single RowsSelection, using IE browser can not select and copy data from the cell, but it work in firefox.
    is it a bug?
    Edited by: kent2066 on 2009-5-18 上午8:46

    Hi Timo,
    Sorry forgot to mention versions.
    We are using 11.1.1.7 and IE 9.
    I tried in Google but could not get the solution.
    Kindly let me know solution for this.
    PavanKumar

Maybe you are looking for