Collapse All and Expand All functionality in Tree

Hi All,
I am using TreeByNestingTableColumn element to display the tree hierarchy .
Does anyone knows how to implement Collapse All and Expand All functionality for this tree (if someone have sample code for these functionality then it will be great for me) ?
Thanks in advance.
Ravi.

Hello Ravindra Sahu,
Code for EXPAND ALL button:
*step 1:Access node
  lo_nd_tree_hierarchy = wd_context->get_child_node( name = wd_this->wdctx_tree_hierarchy ).
*step2: Extract all the table entries from node which is binded to table
lo_nd_tree_hierarchy->get_static_attributes_table(
    IMPORTING
      table = lt_tree_hierarchy ).
*step3:set element attribute Expanded to abap_true
    loop at lt_tree_hierarchy ASSIGNING <ls_tree_hierarchy>.
      <ls_tree_hierarchy>-expanded = abap_true.
    endloop.
*step4: Finally the updated data needs to be binded.
  lo_nd_tree_hierarchy->bind_table( lt_tree_hierarchy ).
Code for COLLAPSE ALL button:
*step 1:Access node
  lo_nd_tree_hierarchy = wd_context->get_child_node( name = wd_this->wdctx_tree_hierarchy ).
*step2: Extract all the table entries from node which is binded to table
lo_nd_tree_hierarchy->get_static_attributes_table(
    IMPORTING
      table = lt_tree_hierarchy ).
*step3:set element attribute Expanded to abap_true
    loop at lt_tree_hierarchy ASSIGNING <ls_tree_hierarchy>.
      <ls_tree_hierarchy>-expanded = abap_false.
    endloop.
*step4: Finally the updated data needs to be binded.
  lo_nd_tree_hierarchy->bind_table( lt_tree_hierarchy ).
Please don't forget giving REWARD points...:-)
Edited by: Bharath Komarapalem on Jul 11, 2008 9:17 AM

Similar Messages

  • Is it possible to remove collapse all and expand all links in HGrid.

    Hi All,
    Is there any way to remove collapse all and expand all links which HGrid shows by default, the reason is when the user clicks on collapse all it will collapse to root node but my requirement is it should collapse untill 2 node level.
    Thanks
    Babu

    From the javadoc of OAHGridBean
    ======================
    void setExpandAllEnabled(boolean expandAllEnabled)
    Indicate whether the "Expand All" (and "Collapse All") links should be rendered for the HGridBean.
    Cheers,
    Ganesh

  • What exactly is the difference between :"Refresh" and "Expand All"?

    They seem to do the same thing most of the time. What is the difference?

    Hi Dermot,
    Well, for a report that uses no expansions the time it takes for Refresh and Expand All should be about the same. Maybe a little bit faster for Refresh. But if your report does have expansions, Refresh should be significantly faster.
    Here is the list of what happens to each EVDRE in your workbook when you click the "Expand All" button: [http://help.sap.com/saphelp_bpc75_nw/helpdata/en/fb/b03d0099e8428d95eb7de2c964cf18/frameset.htm] It has 8 steps. I believe that when you click the "Refresh" button it only executes steps 3 and 4 (not completely sure about that, but you get the point - it doesn't do everything).
    Expand All can get especially problematic when you have a workbook with a large number of EVDREs. In this case, a nice option  is to right-click on the worksheet and take a look at the options under the top menu item. One of the options is to expand only the active sheet, which can save you a lot of time.
    Cheers,
    Ethan

  • Select all and deselect all in table control

    Hi experts,
        I want to make the select all and deselect all options in my table control.
    But i can't able to do that one. Kindly suggest me how to do that one.
    one more thing, if i select some rows in the table control, and press save it should be saved in some other table. how can i implement that one.
    Waiting for ur reply.
    Regards...
    Arun.

    Hi Arun,
    In the context node that you bind to the table, set the cardinality as 0..n and selection as 0..n. In the UI element Table, set the property selectionMode as 'multi'. Then a toggle button for select/deselect all will appear automatically in your table. You can see it in the top left corner.
    For your second question, after selecting the elemets and pressing 'save', in your event handler, do a get_selected_elements( ) on your node. This will return you a set of context elements. Loop through each element and do a get_static_attributes to get the rows. Then you can append these rows to another internal table and bind it to the context. Bind your second table to this node. If the two tables are in different views, the context nodes need to be present in the component controller and mapped to the views.
    Hope this helps.
    Regards
    Nithya

  • My music is completely messed up: many songs shortened to 3:01, many songs in different versions. Should I delete all and reimport all my purchases? Or is there a more elgant way of cleaning the media center?

    My music is completely messed up: many songs shortened to 3:01, many songs in different versions. Should I delete all and reimport all my purchases? Or is there a more elgant way of cleaning the media center?

    I think you should just rebuild your library.
    Clear it out, then drag all the song files back in. You'll lose your ratings and playcounts, etc but I don't see what else you can do.

  • Select  all and dselect all can any body provide a code for these buttons

    hi
    i have taken 4 buttons for select  all and dselect all  and sort up and sort down can any body provide a code for these buttons.
    thanks

    hi,
    Refer this link...
    code for select_all and deselect_all in modulepool

  • Link symbol (Hand symbol) in " Show all" and "Hide all"

    Hi peter,
    With respect to the same topic posted by me, can u help me in
    one more requirement (definitely simple for u)
    When i try to click these show all/hideall buttons (the hand
    symbol) should appear which usually appears when we click any
    link.....how this can be done........

    Hi peter, apart from adding the cursor pointer (per ur
    guidance), i also add some "screen tip text" (For ex. "Click to
    view instructions of all fields)...i included the tag <a
    title="Click to view -----------">
    i'm getting the same screen tip text for both "Show all" and
    "Hide all" buttons (that is obvious)
    If i click "Hide all" button, i want the screen tip text as:
    "Click to hide all instructions"..............probably i need to
    change this in the "showhide.js" (how to do this).............can
    you help me to achieve even this :-) Thankx a lot in advance :-)
    Note: You may thing that this screen tip text is not required
    for these two buttons (as it is self-explanatory) (I too
    know)..........however, i can use this method in any other
    requirement...........

  • Collapse all below and expand all below

    hi,
    Expand all below & collapse all below action are not working for &lt;af:treeTable/&gt; UI component which are provide by &lt;af:panelCollection/&gt; component by default (we dont have control over them). But Action 'expand all below' on selected row is just expanding itself (selected one.)
    Here is the code of implement of treeTable
    &lt;af:panelAccordion inlineStyle="width:100%;" discloseMany="true"
    discloseNone="true" id="regional_panel1"&gt;
    &lt;af:panelCollection
    inlineStyle="width:100%;height:100%"
    id="regional_collection_table_tags"&gt;
    &lt;af:treeTable rowSelection="single" contextMenuId="treeTableMenu"
    rowBandingInterval="1" inlineStyle="width:100%;"
    columnStretching="last"
    value="#{bindings.result.treeModel}" var="node"
    id="TagTree"
    binding="#{pageFlowScope.TagHelper.tagTree}"
    selectionListener="#{pageFlowScope.TagHelper.tableSelectionListener}"&gt;
    &lt;f:facet name="nodeStamp"&gt;
    &lt;af:column headerText="#{bundle.TAG_NAME}"&gt;
    &lt;af:outputText value="#{node.name}"/&gt;
    &lt;/af:column&gt;
    &lt;/f:facet&gt;
    &lt;af:column headerText="#{bundle.DESCRIPTION}"&gt;
    &lt;af:outputText value="#{node.description}"/&gt;
    &lt;/af:column&gt;
    &lt;/af:treeTable&gt;
    &lt;/af:panelCollection
    &gt;
    &lt;/af:panelAccordion&gt;
    Note: Collapse All & Expand All actions are working fine which are also provide by &lt;af:panelCollection/&gt; component.
    Please provide me any info to fix this.
    kind revert me for more info.
    Thank
    KSB

    Hi,
    your panel accordion does not have a showDetail item as a child containing the panelCollection, The IDE should have flagged this as an error. Your problem doesn't reproduce for me
    Frank
    Ps.: component ID should be kept short (less than 7 characters) because they add to the download size and thus contribute to performance degradation

  • My screen keeps shrinking and expanding all by itself!

    The screen on my Mac Book Pro keeps shrinking ad expanding all by itsef. Why is this happening and how do I stop it. it will do it for a few secons at a time.

    There are two possibilities. You could be accidentally activating the Screen Zoom feature, either through its keyboard shortcut or by Ctrl-scrolling the mouse or trackpad. If this is the cause, the edges of the screen are hidden because they've been pushed out when the screen is zoomed up. If this is it, open System Preferences, click Accessibility, click Zoom, and turn off all the check boxes.
    If it is only happening in a few programs like your web browser and it is not cropping out the screen edges, then you could be accidentally using the Smart Zoom feature of the trackpad. If this is the cause, open System Preferences, click Trackpad, click Scroll & Zoom, and turn off Smart Zoom.

  • HT5624 hi ....my huspand gave me his ipod touch and i try to change his apple id to mine and when a want to actualize the app it keeps asking me for his password, cuase it shows his apple id. haw can i change it? ...or should i reset it all and lose all t

    i thought i did but when i go to actualize the app it keeps asking me for his password cuase his apple id shows ....
    what should i do? do i reset it completly and lose all the muisic and pictures?

    - Go to settings>Store and sign out and sign into your account.
    - Apps are locked to the account that purchased them.
    - To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.

  • If I want to create a Listbox to run multple tests, how can I create a check all and clear all button for selection/​deselectio​n of all the tests

    create check all/clear all button for listbox

    Hi Arien,
    Parthabe is right, next time, try to create a new thread.
    So when others try to search for a topic, they can actually find it.
    I developed this example code that you can take a look at.
    It's using property nodes of the chart to control which plot to show and to force invisible
    Message Edited by Van_L on 03-06-2008 07:19 PM
    Van L
    NI Applications Engineer
    Attachments:
    choose plot.vi ‏25 KB

  • Cover artwork, the be-all and end all?!

    Just spent the day with my Napster hard drive (yes, t'was old) and Itunes. I believe I have found the reason for the problems with cover artwork.
    1) In general, artwork will not load if the file is a WAV.
    2) Itunes does not have everything.
    For the first, right click the file, choose "convert to AAC". When done, erase the WAV file. This will save a LOT of space on your Ipod, too. I suspect similar with MP3 files, but I didn't have any.
    For artwork, Google Images, Amazon, and others have artwork. 300 X 300 is the size of the pane, larger will resize, but smaller will not. However, smaller will still work, it will just not fill the pane.
    To insert artwork: right click the file, choose "get info" then click the "artwork" tab. Either click "add", or first "delete" then "add", and then load the image. You can also drag the image into the lower left corner where the artwork displays in Itunes, if you have this option open.
    Note: artwork means just that, you do NOT need to use album cover artwork. You could use pictures of your cat, dog, or next door neighbour, as long as it's a format that is recognised by Itunes (jpg is great). You do not necessarily need square pictures, either, the pic will simply not fill the pane is all.
    Jeff

    I found out that there is no need to convert MP3 files to obtain the same results. Do the following:
    - right click on the first track
    - click on "Get info"
    - click on "artwork"
    - right click on the picture and click on "copy"
    - click "cancel"
    - highlight all tracks of the album by clicking on the first track, then hold "shift" and click on the last track
    - right click anywhere on the highlight and click on "get info"
    - right click in the box labeled "Artwork" and click on "paste"
    - click on OK.
    Your artwork will be generated for all the tracks. Next time you synch your iPod, the artwork will also be tranfered.
    This is something else that is not well documented in the iPod or iTunes manuals!!!!!!

  • Why hasen't Itunes been updated from the ground up? I would love to use Itunes as my be all and end all entertainment player. That would include playing hard media such as DVDs and Blu Rays.

    I would just like to know why Itunes isn't the be all/end all when it comes to being the center of anyone's home entertainment system?
    I would also like to know why Itunes hasn't changed ANY in many years?
    Just curious ...
    Greg

    It has changed and it is bloated enough as it is.  Since the early days they have added Ping, Match, Genius, a whole media store interface, concomitant movie playing, the whole syncing business with a multitude of i-devices.
    There is no need to add a DVD player since DVD Player stands alone quite nicely as it is.  Additionally Apple is phasing out DVDs (note the demise of iDVD, all software now being downloads only, and the disappearance of DVD drives from newer models) since of course you're supposed to just get your movies from the iTunes Store.

  • Sidebar expand folder functionality/ file tree structure

    Is there a way to get "favorites" that I've added to my sidebar to expand in Mavericks? I'd like to show a file tree structure in the sidebar. This would make it SO much easier to move image files one folder up. Right now I have to have multiple folders open or have columns view which doesn't enable me to have a usable thumbnail preview in the working folder. Please help!
    --Francesca

    No.   The sidebar does not provide that; there's no hierarchical navigation within the sidebar.
    If not already doing so, you might consider using tabs for your various Finder views.
    Otherwise, there might be a different option available as a Finder alternative.

  • Post RH 9 Upgrade Expand All and Collapse All not working.

    After upgrading to RoboHelp 9 from 7 - the Collapse All and Expand All is not working.  I am taking over after attending a RoboHelp 9 Training Class a little over a week ago, so any help would be appreciated.

    Hi,
    What is your output? Where are the show/hide buttons placed: In the topic or in the toolbar? You're using RoboHTML right?
    Did you use any kind of twisties in your RoboHelp 7 project? The show all hide all buttons are controlled by a custom script and I'd like to know which method you are using. (If you know which.) See also http://www.grainge.org/pages/authoring/twisty/twisty.htm
    If you're not sure which method you are using, can you post the HTML of the show/hide all button/link?
    Greet,
    Willam

Maybe you are looking for