JTree multiple nodes selection problem !

I can not make my JTree to be in multiple node selection mode.
I have custom tree model and tree node class, the tree model class
implements javax.swing.tree.TreeModel, and the tree node is an ordinary
Java object.
In this setting, my JTree is always in single selection mode.
I have tried set the selection model after the JTree has initialized, and
it didn't work.
What I missed in TreeModel implementation ? Or should my tree node class
also implements javax.swing.tree.TreeNode ?
Don't tell me just call
xxtree.getSelectionModel().setSelectionMode(javax.swing.tree.TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
It didn't work.

Just in case anyone wants to know, I did find the magic number of files, and what the problem is. I talked with tech suppot at Adobe, and they know the problem exists, but won't fix it. I did put in a request in the "Request a Feature" form. Read on:
The magic number is 40 Canon 1Ds Mark III Raw files, and clicking on three or more keywords. The key to not having the numbers of keywords counted incorrectly in the filter pane is to click on the keywords as fast as you can before it starts to write to the metadata. If you click on each keyword one at a time, and wait about a second or more between selecting the keywords, then the counts in the filter panel for the number of keywords is not correct in relation to the number of files that you have chosen to apply keywords to. The cure for this is to click as many keywords as possible as fast as you can before the software starts incorporating the keywords into the metadata.
I would suggest to Adobe, that a nice feature would be that one could click on as many keywords as one would want, to as many files one would want, and then have a button or icon that would enable one to then apply all the keywords at once, instead of applying them as you click them as it is now. I also would love it if Adobe fixed it now instead of waiting to fix it in the version of CS5. Someone on Adobe's support line told me that Adobe would rather wait to put this into the CS5 version than fix it now. I don't think that is right, but heck, I am only one guy who depends on this software to provide images keyworded to my clients in a timely manner. I would never run my business like this Adobe. If there is a problem, and there is, please fix it now, or give me some of my money back since your product has a design flaw that is having a negative impact in my ability to to my job and run my business.
Thanks!
Daniel Root
Portland, OR

Similar Messages

  • Multiple node selection in Hierarchy Variable

    Hi Experts,
    I have a requirement for the capability to select the multiple node in the BPS variable of type hierarchy. This is required in the data slice where my administrator want to select the more than one node at a time for the purpose of locking the transaction records of deferent departments with slice. I see only option to select one node in variable but I would like to know if there are any ways to enhance this variable to select the multiple node...some exit or some thing.
    Any valid suggestions will be fully rewarded with points.
    Thanks,
    Raj.

    Hi Jain
    Thanks for your input. Following is exact requirement for me.
    I have fund center hierarchy and each text node represents one department and all the fund centers under it. Plan administrator wants to lock each department when they are done with the planning. I can achieve this by preparing one data slice for each department and administrator can activate this when they want to lock department but this generates lot of data slices, which may impact the performance of the system a lot.
    Other option I am thinking of is the possibility to use hierarchy variable in data slice to select the multiple departments that are required to be locked at any point in time, so that I can manage this with one variable.
    Other option is selecting individual fund center values  in variables but that is completely ruled out for the given volume.
    If I understand your suggestion right, you are suggesting to create the custom table to store different node values from the hierarchy and use the exit variable in data slice. IF you have any document/code to achieve this, please let me know.
    let me know if you have any other simple way to achieve this.
    Thanks,
    Raj.
    Message was edited by: Raj G

  • Search help multiple values selection problem

    Hello Friends,
    I am using FM f4_if_int_table_value_request FM to display multiple values on selection screen
    in AT-selection-screen on value request event.
    Multiple values are getting displayed perfectly .
    Then after that I am using DYNP_VALUES_UPDATE FM to return the values back to screen.
    But the problem is in the select-option field . It only picks the last value selected.
    I have a row:
    I EQ 'last value selected from F4 help screen''.
    Is there a way to update multiple rows in the select option selection screen field.
    Thanks.

    Hi Suhas,
    you may try the following:
    TABLES spfli.
    SELECT-OPTIONS: s_carrid FOR spfli-carrid.
    SELECTION-SCREEN: PUSHBUTTON /1(20) but1 USER-COMMAND carr.
    INITIALIZATION.
      but1 = 'Choose CARRID(s)'.
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'CARR'.
          TYPES: t_return_tab  TYPE ddshretval.
          TYPES: BEGIN OF ty_line,
            carrid   TYPE spfli-carrid,
            carrname TYPE scarr-carrname,
          END OF ty_line.
          DATA: it_list TYPE STANDARD TABLE OF ty_line,
                wa_return_tab TYPE t_return_tab,
                i_return_tab TYPE STANDARD TABLE OF t_return_tab,
                v_repid TYPE sy-repid,
                v_dynnr TYPE sy-dynnr.
          v_repid = sy-repid.
          v_dynnr = sy-dynnr.
          SELECT carrid carrname
          FROM scarr
          INTO TABLE it_list.
          IF sy-subrc = 0.
            CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
              EXPORTING
                retfield        = 'CARRID'
                dynpprog        = v_repid
                dynpnr          = v_dynnr
    *        dynprofield     = 'S_CARRID-LOW'
                value_org       = 'S'
                multiple_choice = 'X'
              TABLES
                value_tab       = it_list
                return_tab      = i_return_tab
              EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
            IF sy-subrc = 0.
              s_carrid-sign = 'I'.
              s_carrid-option = 'EQ'.
              LOOP AT i_return_tab INTO wa_return_tab.
                s_carrid-low = wa_return_tab-fieldval.
                APPEND s_carrid.
              ENDLOOP.
              READ TABLE s_carrid INDEX 1.
            ENDIF.
          ENDIF.
      ENDCASE.
    What I have done is:
    - not linking the result of the F4 search to field S_CARRID-LOW
    - inserting this F4 search into event AT SELECTION SCREEN. This allows to see the select-options filled when its contents are actually populated.
    I hope this helps. Kind regards,
    Alvaro

  • Outlook 2010 multiple item select problem

    Hi,
    I have a maddening issue with Outlook 2010.  It has to do with a feature that has always worked 100% issue free in older versions of Outlook.
    Outlook is somehow losing its mind where it comes to range selections.  Specifically, there are 2 issues, with steps to reproduce.
    Issue 1:
    step 1) select a message
    step 2) scroll down in the inbox, and shift-select a message 30 lines down (note: any number, not just 30, will do)
    step 3) right click on the range, and select "Mark as read" (note: any other right-click action will do as well)
    note: Upon completion of step 3, the range selection is lost inside of the inbox user interface.
    step 4) to regain the view of the selected range, press and hold the shift key and then arrow up then back down
    note: Upon completion of step 4, the entire range of 30 messages is shown as selected once more
    Issue 2:
    step 1) select a message
    step 2) scroll up in the inbox, and shift-select a message 30 lines above (note: any number, not just 30, will do)
    step 3) right click on the range, and select "Mark as read" (note: any other right-click action will do as well)
    Upon completion of step 3, the range selection is lost inside of the inbox user interface.
    step 4) to regain the view of the selected range, press and hold the shift key and then arrow up then back down
    note: Upon completion of step 4, the entire range of 30 messages is NOT shown as selected; rather, only the number of messages that fit in the inbox view that were part of the selection are shown as highlighted.  ie, if only 10 of the 30 fit in the
    current view, only the 10 are shown as selected.
    This is maddening, as it does not happen every single time.
    Workarounds I have tried that did not solve the issue:
    1) Update all BIOS and driver settings to the latest editions
    2) Replace the mouse
    3) Turn off the preview pane
    4) Deleted the existing Outlook profile, and then created a new one
    Please advise, this is an infuriating issue, which never occurred with older editions of MS Outlook!

    Hello,
    I tried your steps, but I cannot reproduce step 3. The selection didn't lost when I right clicked on the range and selected "Mark as read".
    Please try to open Outlook in safe mode to check if the problem persists. To open Outlook in safe mode, press Windows key + R to open the Run command, type
    outlook /safe and press Enter.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Random Selection Failure - to-spec at line is evaluated to multiple nodes

    Hi,
    Has anybody come across a situation were an assign activity fails with an
    "Exception is thrown because the to-spec at line 113 is evaluated to multiple nodes"
    The problem is that an element in a variable appears more than once although it is restricted to maxOccurs="1".
    e.g
    <variable>
    <outputVariable>
    <part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Output xmlns="http://xmlns.oracle.com/MyApp/MySchema">
    <result/>
    <result/>
    </Output>
    </part>
    </outputVariable>
    </variable>
    The result element has a maxOccurs="1" in the xsd and the operation in the assign activity is a copy not an append!
    The problem is not consistent and happens randomly with the same set of data.

    Hi I understand the workaround here (adding [1] to the to-spec expression) - but what about the extra empty nodes, when we move to the next step in our process will those empty nodes still exist - since our XSD sets that node to maxOcurrs="1" this would cause issues down stream if these empty nodes are carried forward - we are thinking of putting in a XSLT to remove them, but wanted to see if anyone has input on if they will be carried forward - since this is a random issue ware not able to reproduce it in our dev/test environment, it seems to only happen in our Production environment.

  • Select multiple nodes in a JTree a right click

    Hi all,
    I've a JTree and I'd like to allow the user select some nodes (one or more) right click and than show a popupMenu.
    This behavior seems not to be easy, because if I select a single node (right clicking on it) the node does not appear selected ; I need to select it left clicking and than everything works fine.
    I read some posts found in the forum and the solution seems to be :
    - attach a mouseListener to the JTree
    - get the TreePath of the node selected
    - force the selection on the node with setSelectionPath(TreePath)
    This works fine if you need to select only one node, cause if you have to select more, you simply cannot.
    I wonder a so obvious behavior is so hard to achieve.
    I hope somebody out there had made the magic.
    Any help would be appreciated.
    Flavio Palumbo

    Hi Darryl,
    I wrote the test case below.
    Using the methods you suggested it works almost fine.
    The only behavior not desired is when you select a range (shift or control), release the key an than right click ; in this case remains selected the only node you clicked on ; to select the range clicking with the right button, you have to keep pressed the key.
    Any hint would be appreciated.
    Flavio
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JFrame;
    import javax.swing.JMenuItem;
    import javax.swing.JPopupMenu;
    import javax.swing.JTree;
    import javax.swing.SwingUtilities;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    public class TestTree {
        JTree jtr = null;
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new TestTree();
        public TestTree() {
            JFrame jf = new JFrame();
            jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            try {
                javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
                javax.swing.SwingUtilities.updateComponentTreeUI(jf);
            } catch (Throwable e) {
            jf.setPreferredSize(new java.awt.Dimension(200, 560));
            javax.swing.JScrollPane js = new javax.swing.JScrollPane();
            DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
            jtr = new JTree(root);
            jtr.addMouseListener(new TestTreeML());
            js.setViewportView(jtr);
            jf.getContentPane().add(js);
            for (int i = 0; i < 20; i++) {
                DefaultMutableTreeNode nodoFiglio = new DefaultMutableTreeNode("nodo" + i);
                ((DefaultTreeModel) jtr.getModel()).insertNodeInto(nodoFiglio, root, root.getChildCount());
            jf.pack();
            jf.setVisible(true);
        public class TestTreeML extends MouseAdapter {
            @Override
            public void mousePressed(MouseEvent e) {
            @Override
            public void mouseClicked(MouseEvent e) {
                try {
                    if (!e.getSource().equals(jtr)) {
                        return;
                    TreePath tpSel = jtr.getPathForLocation(e.getX(), e.getY());
                    if (tpSel == null) {
                        return;
                    int i = 0;
                    final DefaultMutableTreeNode node = (DefaultMutableTreeNode) tpSel.getLastPathComponent();
                    TreePath[] tpExisting = null;
                    if (e.isControlDown() || e.isShiftDown()) {
                        System.out.println("control/shift");
                        TreePath[] tpEx = jtr.getSelectionPaths();
                        tpExisting = java.util.Arrays.copyOfRange(tpEx, 0, tpEx.length + 1);
                        i = tpEx.length;
                    } else {
                        tpExisting = new TreePath[1];
                    tpExisting[i] = tpSel;
                    jtr.setSelectionPaths(tpExisting);
                    if (e.getClickCount() == 2) {
                        System.out.println("double click on " + node.getUserObject());
                    if (javax.swing.SwingUtilities.isRightMouseButton(e)) {
                        if (!e.isControlDown()) {
                            jtr.setSelectionPath(tpSel);
                        JPopupMenu menu = new JPopupMenu();
                        JMenuItem it0 = new JMenuItem("Option1");
                        it0.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("Option1 on " + node.getUserObject());
                        menu.add(it0);
                        JMenuItem it1 = new JMenuItem("Option2");
                        it1.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("Option2 on " + node.getUserObject());
                        menu.add(it1);
                        menu.show(jtr, e.getX(), e.getY());
                } catch (Throwable t) {
    }

  • How to set a particular node selected in a JTree from within the model

    I have an adapter class that provides communication between my JTree and data model. My adapter class implements TreeModel, TreeExpansionListener, TreeSelectionListener and a listener for changes to my data model.
    My data model keeps reference to the currently selected node. It is working quite nicely when I select a tree node with the mouse (the data model is updated accordingly with the node selected), however my problem occurs trying to go the other way (set the selected node in my data model and have it reflected in the tree).
    I know that my selection in the tree is changing correctly as when the selection changes it fires off an event to update the attributes window associated with the currently selected node. I just can't get the node to become highlighted.
    Any ideas would be most welcome.
    Thanks,
    Beck.

    Does your model really have to keep track of the selected item or can the two views (the JTree and the attributes window) not be coupled together in the user interface instead?
    Failing that, you could always consider implementing TreeSelectionModel as well and calling JTree.setSelectionModel since you're keeping track of the tree selection for it already. This is quite a bit of work though.
    If that's too much trouble then if you can work out the TreePath for the node that's been programmatically selected through your model then you could use JTree.getSelectionModel().setSelectionPath. Have a look at tree.getSelectionModel().setSelectedPath(new TreePath(selectedObject)).
    This approach is a bit warped, though, since it implies that your model knows about the view and therefore couples them together.

  • Get Node Key Multiple Items Selected  from ALV tree

    Hello Experts,
    I'm having a problem in getting Node keys for the items displayed as ALV tree.
    I'm able to get Node key, when only ONE record (Item) is selected.
    But, when I select multiple items under a Single node am not able to read(get) the node keys for all the selected items.
    I'm using the classCL_GUI_ALV_TREE.
    I have tried using the method GET_CHECKED_ITEMS, but not getting the keys.
    method GET_SELECTED_ITEM is giving node for a single item. I need it for multiple items selected.
    Thank you for your time.
    -SANGAR

    Hi,
    You need to use checkbox concept. and use method GET_CHECKED_ITEMS get selected items
    please check this tread.
    CL_GUI_ALV_TREE and Checkboxes
    aRs

  • Selecting multiple nodes of a tree through ctrl+shift

    Can i select multiple nodes of a tree through ctrl+shift.
    How??
    Thanx

    Take a look at JTree#getSelectionModel() and TreeSelectionModel#setSelectionMode(int).
    _myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);

  • Selection problem in JTree

    Hi,
    I am setting the selection mode for a JTree to be single selection. Suppose the node which I selected was in expanded state, after making the selection it is in collapsed state. Now suppose I want to resume the expanded state and again try to select the same node without making any intermediate selection the listener doesn't listen. But if I make make a different node selection in between the 2 consecutive selections made to the same node the 2nd selection is listened.
    Is it something like if two similar selections are made one after the other the second one is discarded or not listened. If so how can I overcome this? If not please tell me where am I making the mistake.

    selection will be fired only when the selection property changed. so, collapsing and expanding should be done in mouse event handlers.

  • Select the multiple nodes in a tree

    Hi Experts,
    We need to select the multiple nodes in a tree.Whatever we are selecting,that has to be added in the table as a tree structure itself.
    For ex:
    A
    |--A1
        |--B1
    If We select the A then A,A1 and B1 has to be added in a table.Please help me out for this.
    Regards
    Nutan
    Edited by: Armin Reichert on Jan 29, 2008 2:33 PM

    Hi,
    You have to create a recursive node and use the tree by nesting UI component
    Following tutorial will be of use
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20tutorials%20and%20articles%20archive/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf
    Recursive Node
    http://help.sap.com/saphelp_nw70/helpdata/en/5d/97384162316532e10000000a1550b0/frameset.htm
    TreeByNesting
    http://help.sap.com/saphelp_nw70/helpdata/en/92/12a74046033913e10000000a155106/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#31 [original link is broken]
    Regards
    Ayyapparaj

  • Multiple value selection lists - Problem filtering

    I'm builing a news application with publisher, and one of the fields is a multiple value selection list. We're filtering news stories to different pages based on the values. Problem is, I can't get the right content items to display. I did it no problem with a single selection box. The code I'm using is:
    <pcs:foreach expr="folderByPath(folder, '../../Articles')" var="articles">
         <pcs:foreach expr="articles" var="art">
              <pcs:if expr="art.testkeyword == 'choice2'">
                   </pcs:value>"><pcs:value expr="art.headline"></pcs:value></a><br />
              </pcs:if>
         </pcs:foreach>
    </pcs:foreach>
    So if 'choice2' is in a single select list, no problem. If it's part of a multiple select, I get nothing. I'm thinking I'm missing something really easy, like logic operators. But I couldn't find anything of help in the documentation

    Hi,
    Make use of contains function.
    Syntax : contains(string1,string2) this returns true if string 1 has string 2
    Usage
    <pcs:if expr="contains(test,'A')">
    </pcs:if>
    ** 'test' is the name of the multi select box
    Edited by bharatkarthik at 06/22/2007 4:10 PM

  • Select an attribute of a multiple node......?

    Hi,
    I have created on simpletype in local dictronary(Key) in .... and i have created anoter key of this type in custom contoller... i have mapped this to my view context node attribute..... I have DropDownByIndex element i want to set Key node element to my texts property.... but i am getting the "Select an attribute of a multiple node.." error.....why i am getting this?
    and
    I have created a materialNumber model attribute in my view context and i mapped this to materialNumber of custom controller context attribute...... i want to set this to texts property of DropDownByIndex element... but i am getting the same error.... why i am getting this error...
    Help me
    Best Regards
    Ravi Shankar B
    Message was edited by: RaviShankar B

    Ravi,
    Then let us fix this error instead of introducing other one
    1. You have some context attribute in custom/component controller.
    2. You map this attribute to attribute in view controller.
    3. You are trying to modify simple type of attribute in view controller.
    Step 3 is wrong -- move your code that modifies simple type of attribute to custom/component controller, where attribute was defined. Mapped attribute in view controller will get modified type automatically.
    Then, obviously, use DropDownByKey.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Assigning multiple nodes problem

    Hi everyone. I am new to the Oracle SOA Suite and I am using release 11g. Here is what I am trying to accomplish -
    I have an element of with multiple nodes (carTypes) and within that I have the car's color, year, and make. I loop through the array and try to assign only cars within a year range so that the response will show all the nodes of those years. But, the only carType node within in year range that shows in the response is the last node in the range.
    For example, I have have 3 car years that are within range so the response should show -
    <car-root>
    <carType>
    <name>Ram</name>
    <color>Red</color>
    <year>2000</year>
    <make>Dodge</make>
    </carType>
    <carType>
    <name>Carrola</name>
    <color>Black</color>
    <year>2001</year>
    <make>Toyota</make>
    </carType>
    <carType>
    <name>Malibu</name>
    <color>Blue</color>
    <year>2002</year>
    <make>Chevy</make>
    </carType>
    </car-root>
    But...
    It only shows the last one -
    <carType>
    <name>Malibu</name>
    <color>Blue</color>
    <year>2002</year>
    <make>Chevy</make>
    </carType>
    </car-root>
    Looking at the trace It looks like it is just overwriting the node instead of making multiple nodes.
    How do I have it create multiple nodes so that I can get the response showing all cars within range?
    Thanks for taking a look.
    Edited by: 984188 on Jan 25, 2013 3:00 PM

    I am beleiving that your requirement is
    1) To reply back with all the CarTypes that are in a given range, then reply back with the list
    2) Otherwise reply back with the a fault that contains all the CarTypes that are not in the given range.
    If that is the case:
    Then to implement "part (1)" you already have solution. For "part (2)" create another vairable 'tempVariable' and collect all the CarTypes again, simillary to what you did for the step 1, using For Each an If , however, this time the condition for the if will be the opposite of previous one.
    Finally, before replying, check the contents of the 'tempVariable', if it not empty reply with fault otherwise give the proper reply.
    P.S.:While loop in BPEL is costly, use the costructs like while, if they are mandatory and not avoidable (Don't use them as you would use in OO/procedural languages)
    Mark the posting appropriately, as "Helpful", "Correct Answer", if your issue is resolved.

  • Multiple row selection for table element

    Hi,
    I have a requirement where I require to select multiple rows from a table element in a WD for abap application.
    I have defined a node with cardinality and selection set to 1..n.
    The contex node contains 4 fields : emp_name, pernr, manager and position.
    The attributes of the table element for selectionmode is set to 'multi' and 'selectionchangebehaviour' is set to 'auto'.
    I have defined an action on the 'onleadselection' event.
    The code in this method also includes the statement 'lo_el_team_view->set_selected( EXPORTING flag = abap_true ).' 
    When I execute the application only 1 row is highlighted at any one time when I select it. You can select multiple rows by holding down the 'ctrl' key but I want to avoid having to do this. Is there anything I have missed out causing multiple row selections not to be all highlighted.
    Thanks in advance for any assistance.

    Hi raj,
    you can try the following code in the 'onleadselect' event of the table,
    create one attribute ' Flag'  of type WDY_BOOLEAN under the node which has been binded to the table.
    DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.
      DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.
      DATA  lo_elements TYPE wdr_context_element_set.
      DATA  lo_ele_select_new TYPE REF TO if_wd_context_element.
      DATA lv_deselect TYPE wdy_boolean.
      DATA lv_flag TYPE wdy_boolean.
      DATA lv_select TYPE wdy_boolean.
      DATA lv_index TYPE i VALUE 0.
      lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).
    get the current selected element
      lo_ele_select_new = wdevent->get_context_element( name = 'NEW_ROW_ELEMENT' ).
      CHECK lo_ele_select_new IS NOT INITIAL.
    check whether it has been selected or not
      CALL METHOD lo_ele_select_new->is_selected
        RECEIVING
          flag = lv_select.
      lo_ele_select_new->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_deselect ).
    check whether element has been previously selected or not,if not, set the flag to select it
    IF lv_select IS NOT INITIAL AND lv_deselect IS INITIAL.
        lo_ele_select_new->set_attribute( name = 'FLAG' value = 'X' ).
    if selected currently and previously then set the flag as false,in order to delect it
      ELSEIF lv_select IS NOT INITIAL AND lv_deselect IS NOT INITIAL..
        lo_ele_select_new->set_attribute( name = 'FLAG' value = ' ' ).
      ENDIF.
      CALL METHOD lo_nd_node_tab1->get_elements
        RECEIVING
          set = lo_elements.
    according to the falg, select and delect the elements
    LOOP AT lo_elements INTO lo_el_node_tab1.
        lo_el_node_tab1->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_flag ).
        IF lv_flag = 'X'.
          lo_el_node_tab1->set_selected( abap_true ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).  * this statement deselects the lead selection index*
        ELSE.
          lo_el_node_tab1->set_selected( abap_false ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).
        ENDIF.
      ENDLOOP.
    I hope this resolves your problem.
    Thanks,
    krishna

Maybe you are looking for