Select multiple items in the tree programmatically

What is the approach recommended for selection by program several elements in a tree? There is an API on the model of selecting either TreeView.getSelectionModel () .select (t, object) to select a single item, but it is not an equivalent API to select multiple items, i.e. TreeView.getSelectionModel (.select(T...objects)).

One approach is to expand the tree and iterate through all nodes and calculate the index of each item to be selected and then call the method TreeView.getSelectionModel ().selectIndices(int...indices).
In my case, I want only the records that contain the selected items to be developed for an additional step is to browse all folders and the collapse of those that do not contain the selected items.

Is there an easier approach?

Thank you.
Stefan

Don't do what suggests Zonski! :-)
These lists are read-only - you will quickly get a runtime exception.

The best approach is to just a multiple selection to be on and then loop through the desired selection list, by selecting each element individually. Because multiple selection is enabled, select calling repeatedly will not erase the previous selection.

-Jonathan

Tags: Java

Similar Questions

  • Impossible to select multiple items in the list box

    I use Acrobat 9.0 Standard.

    I added a list box in the PDF format and I want to give people the ability to select multiple items in the drop-down list. In properties, on the Options tab, I chose 'multiple choice '. But I am unable to make multiple selections despite this. It still only allows me to make a choice.

    Any ideas? Is there some other step I'm missing?

    I need help with this ASAP for my business - any suggestions are appreciated!

    Thank you

    It should do that if you hold down the SHIFT key.

  • How to select multiple items in the Panel of DOM? I tried to use the SHIFT key, but it doesn't seem to work.

    I need help, select several items in my Panel of DOM, for some reason, using the SHIFT key does not work.

    I found the answer, apparently everything I had to do has been updated to the latest version of dreamweaver cc 2015.2. The Shift function is something new added in the update.

  • How can I select multiple items in the list of the spark without pressing the command?

    Hi all

    I need to change the behavioral list to allow multiple selections by clicking on each item

    In the list, instead of using the control

    30:

    Elazar r

    This blog explains how: http://flexponential.com/2009/12/13/multiple-selection-in-a-spark-list-without-the-control - key /

  • Cannot select multiple items in the files section

    The subject says it all. The check mark button that should appear in the upper left area of the files section in the creative cloud is not there for me. I tried several browsers on PC and Mac.

    Any help would be greatly appreciated.

    When you are in the files section, you must click on the button display of the list and then check boxes appears. See screenshot:

  • BlackBerry smartphones to select multiple items

    How to select multiple items on the storm?

    OK figured it. Only works on the E-mail list. Why would anyone want to select more than one email?

  • How to select and move more than one bookmark at a time? Shift + click selects multiple items that are next to each other in a list, because the element

    How to select and move more than one bookmark at a time?
    Shift + click selects multiple items that are next to each other in a list, because the items open in firefox before that happens.

    Glad it worked for you. Thanks for posting back.

  • Name of the selected item in the tree

    Hi all..!

    I m new to Flex.
    I m using a tree control that uses XML as a data provider.
    I want to perform certain operations on the basis of the selected item in the tree. SelectedIndex tried but it didn't work the index coz changes when the nodes of the tree are drill down or drill upward.

    Can someone help me please... Its urgent

    Vishal :)

    Hello

    I modified the sample in the URL below to use the data you provided. Please check out if the sample code attached.

    http://livedocs.Adobe.com/Flex/3/langref/MX/controls/tree.html

    I hope this helps.

  • Select multiple items using a selection list?

    Hi all

    In my application, I have a HTML area with two elements of the selection list. According to the first value of the selection list, the second selection list will fill up.

    Now I want to show a report based on the second select value list, but I want to select several values in the second selection list. For this, I just activated the multiple selection option in the selection list item.

    But when I tried to implement this, the error occurs.

    Select multiple items using a selection list? If this is the case, how can I assign these values in the selection list element onchange attribute.

    Thank you
    David...

    A further possible solution to that above with the function of pipeline is to simply use Instr.

    Note: This option should be used if the amount of data is small or already filtered by other predicates.

    SELECT display_value, return_value
      from xxx
     where INSTR(':'||:P1_MASTER_MULTI_SELECTLIST||':', ':'||parent_value||':') > 0
     order by display_value
    

    BTW, if you use the new attribute "Cascading LOV Parent éléments" in the LOV section and set it to your parent element (in my example P1_MASTER_MULTI_SELECTLIST), the agenda of the child page is automatically updated if the master multi selection list is changed.

    Concerning
    Patrick

  • Sort the items in the tree manually

    I am trying to allow the user a way to move through the items in a tree 2 levels deep. This will give the user the possibility to order the items within the tree, so they can be sent to the word in the desired order. I have working code to get through the items at the lowest level, but I can't that it works correctly for items in folder level. I have a code that works very well, but he has a little problem. I found that if you stay with moving a folder to the top of the tree then you do not experience the problem. However, if you switch to another folder to move then you will experience the problem earlier. The problem seems to be a copy of a part of the tree and add at the end. I don't know, what's happening! I was hoping that someone could help me with that.

    Does anyone know a way to do this? Oh yes and I wish that property selectedIndex to stay with the folder selected as well.

    Thanks for your help.

    It can be done, Sephiroth did a drag ' n drop component
    to sort items in a component of the tree.
    http://www.sephiroth.it/file_detail.php?ID=133

  • Select multiple items in a menu list

    I recently picked up a site for someone who asked me to create a list of items for the user to select "How did you find our Web site" I have read the Help menu on DW8 and created a list/menu, etc. But when I check multiple items in the list, it is still only one item in the form that is sent to me. What I am doing wrong?

    www.blessedunions.com/contact.html


    Thank you!

    Here's what fixed it: I changed to individual boxes and change the 'value' of each radio button to "Yes".

  • How to select multiple cells at the same time?

    Hello

    How to select multiple cells at the same time? What is the keyboard shortcut?

    Thank you to.

    Flo, a french guy.

    Hold down the CMD key when you select the cells.

  • Adding items to the tree in an effective way

    Hello

    I am trying to add items in the tree.

    The problem I am facing is, I have to update the tree constantly and add elments.

    To add first items bit it takes less time, but as the tree grows the accumlated gets.

    Demo Vi is attached for reference.

    Any HELP WILL BE GREATFUL. (vi ATTACHED IS in 2009 version)

    First of all, 1% for calibration of time Windows is 'no difference '.

    But indeed, the update of the front panel is not the factor limiting here: this is the number of children-entries that create problems. So with zero children (as I did in my first test), to postpone the updates done grant you a huge performance increase as is the one and only overhead.

    In your case (100 children), defer updates is disabled the relevance as the method 'Add items' takes awhile.

    I agree that the performance impact is huge, maybe too big, to increase the number of children. But on the other hand, you must understand that you are dealing with arrays of cluster... is in fact a big effort for the memory manager to allocate enough memory, copy of things around and (internally) the deallocation of memory. It's the more data, the most important, this will create. Therefore, it will get slower the more data that you add. But certainly, the measure is surprisingly high.

    But nothing you can change.

    To the last comment: why do you need a tree that changes many times during execution while maintaining several 100ths of elements in any combination of parent/child?

    Norbert

  • Header download for the 'sent items' folder did not complete. Cannot select "Sent items" on the IMAP server. Error number: 0x800CCCD2

    original title: error number: 0x800CCCD2

    Can anyone help with this issue:

    Header download for the 'sent items' folder did not complete. Cannot select "Sent items" on the IMAP server. You could try refreshing your folder list to synchronize with the IMAP server. Account: 'AOL', server: 'imap.aol.com', Protocol: IMAP, server response: "SELECT failed", Port: 143, secure (SSL): no, error number: 0x800CCCD2

    Thank you!

    Hi again Steve - I have spent a lot of time on the phone this morning to Dell technical support. the accompaniment of the victim and I did a lot of fiddling around with various options of Windows Mail and I don't know exactly what we were doing, but the issue seems to have resolved itself! Thank you for your time and trouble.

    Best, Douglas

  • "Unable to select"Sent items"on the IMAP server.

    I am trying to set up Windows Live Mail, but when I send a message, I get the error message "Cannot send or receive messages on behalf of Aol."  Header for the "sent items" download did not complete.  Cannot select "Sent items" on the IMAP server.  Try to update the list of folders, and then try again. "I can't understand what they mean on the"folder list ".  What should I do?  Thank you.

    Thank you for visiting the Microsoft Answers site.

     
    The question you have posted is related to Windows Live Mail and would be better suited to the Windows Live community. Please visit the link below to find a community that will support what ask you:
     
    http://windowslivehelp.com/product.aspx?ProductID=15

Maybe you are looking for

  • GTA 4 will not work on windows 7.

    I went through the installation always process then clicking and just try to be done with the process. those that it has been installed. It came to a black screen. I even tried the Windows XP (service Pack2) on windows 7, it still does not work.i cli

  • Re: HP Support Assistant

    I have a 57-229WM computer Compaq Presario CQ and need to know if there is a more current than the available 7.0.39.15 HPSA or is it the last available version... ? Any available info would be greatly appreciated. The op sys is Win 7 Home Premium 64-

  • Don't have improved equipment and now he doesn't accept activation

    I replaced my card mother, cpu and ram. I did not reinstall Windows 7, but it wants me to reactivate and does not accept the product key. I have the windows 7 Upgrade Family Pack.

  • Torch Smartphone blackBerry called ID

    Anyone know how to activate the torch display the caller's name if its on your contacts list? (I hard it is a default behavior on all phones... but the watch torch phone number and not the name of the caller if there is on the list of contacts).

  • Premiere Pro without creative cloud? I cannot find...

    Hello! I'm SimoneCurrently I have an Adobe premiere elements, but I want to Premiere ProMy problem is that I don't want "Creative cloud..." I don't want to pay the subscriptions each month!I want just the software (for download)There are? I can't fin