Handling event for Tree Control Collapse

Hi,
Can any one suggest how to handle an event for 'Tree Node Collapse' . I have checked with all the exised tree events.
thanks,
Venu

Hi Venugopal,
    If you are doing tree control programmin then i can suggest you a approach for tree node collapse and expand.
for doing this follow these steps.
1. create a toolbar (use class cl_gui_toolbar), add a button and assign a FCODE to it.
2. here you register the following the event for the toolbar.
gs_event-eventid = cl_gui_toolbar=>m_id_function_selected.
3. here you set the handler for the toolbar events
  SET HANDLER  gref_application->handle_function_selected
            FOR  gref_toolbar.
4. now in your class for gref_application you write a definition and implementation.
definition
handle_function_selected FOR EVENT handle_function_selected OF cl_gui_toolbar IMPORTING fcode.
implementation
CASE fcode.
   when 'collapse'.
      CALL METHOD xref_tree->collapse_all_nodes.
this method might change depending upon the class you use for creating the tree.
i hope this will help you.
in case of clarification do get back to me.
regards,
Kinshuk Saxena
PS mark helpful answers

Similar Messages

  • How to handle events for Tab Control

    Hi,
    I have a Tab control with 4 tabs and I would like when I go to a specific tab all the contents of that tab being updated. Could you please help me with this?
    How should I set the event structure
    Thanks

    Tab Control->Value Change is the event you want.  You can then use a case structure to do whatever you need it to based on the "New Value".
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Handling events for

    I have a JApplet (menuhandle.java) that adds a menubar. While handling events for the "Open" menu item under File menu(to make it show the OpenFileDialog box) a NullPointerException was thrown. How should this be overcome?
    public void actionPerformed(ActionEvent e)
    if (e.getActionCommand() =="Open")
    chooser = new JFileChooser();
    int returnVal = chooser.showOpenDialog(new menuhandle());
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    ExampleFileFilter filter = new ExampleFileFilter();
    filter.addExtension("dcm");
    filter.setDescription("Dicom files");
    chooser.setFileFilter(filter);
    if(returnVal == JFileChooser.APPROVE_OPTION)
    File file=chooser.getSelectedFile();
    if(filter.accept(file))
    str=file.getName();
    I need to display the Open File dialog box and also retrieve the file the user actually selected, in order to do certain manipulations with it. Can somebody tell me how to go about this?

    Just a guess, but could the problem be related tothe
    fact that for security purposes many file
    manipulation functionality is disabled in applets?Indeed. The SecurityManager for unsigned applets does
    not allow the use of JFileChooser
    Thanx a lot. But if i make menuhandle .java as a simple class (without extending JApplet) and then try to use this class from inside another applet........will this work? Or will the SecurityManager still not allow the use?

  • Problems handling xml data for tree control.

    Hi,
    I have tried using tree control for displaying my xml data
    but I had a problem that i did not have labels in my xml data. A
    sample xml data is attached. So it displays the whole data at each
    level in the tree. The root label will be the entire the xml data
    and then one level down the remaining xml data and so on...
    How do i solve this issue i,e get the tags names itself as
    labels..
    Thanks in advance....

    An update after some efforts..
    Could get the folders perfectly i.e until the level of
    CPUTime perfectly but could not get the leaf: 32 since i used the
    following to set the label.
    I would like to know if there is a way to find out if a node
    is a leaf or folder and according set the label

  • Callback functions to handle events for a specific system build block

    I have two questions about customized event handling in Systembuild:
    1- The SystemBuild Utility "sysbldEvent" can bo used to specify additional actions for the "openblock" and "navigate" events. However, it will be applied to all systembuild blocks.
    Is there a way to limit its scope to a specific block or block type?
    This has been done for the Altia block (which is a customized UCB block) - a double-click will open a special dialog box. Is this feature implemented using publicly available systembuild features or there are other special features used?
    2- Is there any way to assign callbacks to other type of block events: copy, paste, etc ...
    Thanks.

    Farshid,
    There are a couple of options for creating custom dialogs/blocks.
    SysbldEvent can be used. As you noted it will generate and event for all the blocks. You can not generate an event only for a specific block. However the Xmath function has two values sent to it. One is the type of event (blockopen or navigate) and the blockId. You can use blockId together with SBA commands to find out which block generated the event. If it is a block that you are not interested in then return 0 and SystemBuild opens the normal dialog. If it is the right block then you can open your own dialog or perform what ever action is needed. Finally return a 0 if you want SystemBuild to still open the normal dialog, or you can return 1 and no dialog is opened.
    The Altia
    block is a custom block. It is a standard UserCode block that has been customized to have differnt default parameters and different icon. In the SystemBuild editor (not catalog browser) select a block and the go to Edit>New Custom Block. The custom block can a have a MathScript function associated with it that gets called when the block is created. For more information on custom blocks see chapter 18 of the SystemBuild Users Guide (Help>Search MATRIXx Bookshelf from Xmath).
    The final method is creating a component. For a component percent vars can remain internal or they can be available to the user. You can also provide a different set of parameters that are available to the user, and then provide equations for how they map to the internal percent vars. Information on Components is in Chapter 17 of the SystemBuild User's Guide.
    Carl L
    National Instruments

  • Starting event for MQSeries control

    I am new to Integration. I'm testing a simple MQSeries control. I just want the control listen to a q, get the message and put the message on another q.
    What is the starting event for this type of process? Do I have to use a message broker?
    thanks.

    You can use the control only from an already running process. I you need to start a new process, whenever a message arrives in a MQ queue, then use the event generator, which communicates via Message broker events.
    -Kai

  • Handling events of ActiveX controls in TestStand!rol

    Hi,
    I want to use the Microsoft WINSOCK control with existing ActiveX Automation Adapter of TestStand. These control generates an event in case of incomming data.
    Question:
    Is there any way to treat the events of such controls in TestStand (same problem with MSCOMM control) or can this only be realized by polling the size of incomming buffer?
    In case of answer two, i would be interested in any realized example.
    Regards,
    Sunny

    Hi Sunny,
    Currently, you cannot call ActiveX controls using the ActiveX Automation Adapter in TestStand. To do this, you would need to call a code module that was set to display/utilize the control, and retrieve all of the events generated by the control. TestStand can only currently call ActiveX servers (either DLL or EXE) that support the IDispatch interface. Hope this answers your question.
    Regards,
    Bob

  • Want to handle event for component defined inside skin for host component

    Hi,
    Following is how my skinned button looks -
    As can be seen, there is a checkbox - which is a part part button skin.
    When mouse is over chckbox area and does clicked, I wanted to capture that event for checkbox as target. Objective is to mark checkbox as checked or unchecked when clicked on. I don't want checkbox to change its state when mouse is clicked over other area in button.
    Don't know whether it is possible or not. If yes, what is the best way to do it.
    Thanks in advance,
    Prithveesingh Zankat.

    Hello!
    I face the same problem with Failed to create delegate for component:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component
    XXX.YYY.ZZZ..ume.Ume. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
    Caused by: java.lang.reflect.InvocationTargetException
    Caused by: java.lang.NoClassDefFoundError: com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClass
    I think this started after upgrading from 7.01 SP3 to SP5, but I'm not sure.
    What was it that solved your issue?
    *I found the error. My ProjectProperties.wdProperties did not contain the references it needed.*
    Edited by: Richard Linnander on Nov 23, 2009 2:33 PM

  • Need help for tree control

    Hi everybody,
    I am getting a display problem with tree control. The tree
    control has a fixed height and width, and has quite a few nodes
    with different level of branches. When i have the tree fully
    expanded, then I am getting both horizontal and vertical scrolls.
    If I scroll down using vertical scrollbar and scroll right using
    horizontal scrollbar, I am able to see the tree node labels
    properly. But after that if I scroll up then the nodes that had got
    hidden due to the previous down scroll appear cut off.. the label
    is half way erased.

    Hi everybody,
    I am getting a display problem with tree control. The tree
    control has a fixed height and width, and has quite a few nodes
    with different level of branches. When i have the tree fully
    expanded, then I am getting both horizontal and vertical scrolls.
    If I scroll down using vertical scrollbar and scroll right using
    horizontal scrollbar, I am able to see the tree node labels
    properly. But after that if I scroll up then the nodes that had got
    hidden due to the previous down scroll appear cut off.. the label
    is half way erased.

  • Collapse event for Tree GUIBB

    Hi experts,
    I am implementing a tree GUIBB. I need to react on a collapse event of one single node within the tree. ( The content of the row should change depending whether the code is expanded or collapsed).
    The only event that can be fired in thie case is a Lead of selection event without meaningful information, to react on the selected tree node.
    Is this a bug in the Tree GUIBB or a limitation?
    Dow have any ideas how to solve this issue?
    kind regards,
          Sahla

    Hi experts,
    I found the answer to my problem.
    The  value of the column with column_type if_fpm_guibb_constants=>gc_guibb_tree_columns-expanded. is changed from outside in ct_data!!
    ct_data is a parameter of get_data.
    Therefore we have the information and we can react.
    kind regards,
         Sahla

  • ALV: how to handle event for multi (lead) row selection ?

    Hi,
    I use editable ALV and configure it for multi (lead) selection. Works fine.
    But I could not find any event handler for reading the selected lines.
    There is only the Event handler ON_LEAD_SELECT: this works only for 1 line
    (the lead line). But I could not read multi lines. Who can help?
    Thanks in advance, Christian

    Hi Christian,
    did you try a custom button?
    Try a call
    node->GET_SELECTED_ELEMENTS
    I cant remember if ALV sends event when multi-selection is on for each row selection.
    ie as each row is selected, do you get control ?
    If so, then you should still be able to call node->GET_SELECTED_ELEMENTS .
    regards
    Phil.

  • Invalid input event for numeric control

    Need to catch the event when invalid input being through out, customer doesn't like the notify.
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

    I haven't had a big problem with this, and I plan to continue to use numeric controls instead of making everything strings, but it does seem strange that CVI doesn't catch this.  I like the automatic range checking options, the programmable increment/decrement buttons, and the ease of use.
    You can use a quirk in CVI to catch this: if you enter an invalid number like 1.2.3 or 3...14159 or 1-2, CVI triggers EVENT_VAL_CHANGED, but leaves the original number unchanged.  So you can create a case in the callback for the numeric control for EVENT_VAL_CHANGED, and in that case check to see if the value is the same as the previous value.  If it is, assume an invalid input.  EVENT_VAL_CHANGED does not get fired if you just press Enter without changing the value.
    There are a couple of limitations or drawbacks to this approach.  It doesn't save your invalid entry, so you have to enter the whole thing again instead of just correcting your mistake.  EVENT_VAL_CHANGED also gets fired if you use Delete or Backspace, even if the number you end up with is the same as the previous.  So this approach will flag that as an invalid entry.
    See the attached example.
    Attachments:
    TestInvalidInput.zip ‏6 KB

  • CFDebug says, "widget: Firing selection change event for tree id: t1"

    How do I capture this event and code against it.  Previously used this code to trap click event:
    YAHOO.example.onTreeViewAvailble = function() {
      var curTree=ColdFusion.Tree.getTreeObject('t1');
      curTree.subscribe("labelClick", function(node) {  
       TreeItemClick(1,node.data.id)
      When the tree becomes available (ie. after the page loads),
      this code will run the code above this.
      "t1"- tree name in the cftree tag
    YAHOO.util.Event.onAvailable("t1", YAHOO.example.onTreeViewAvailble); 
    I am obviously not an expert with the Yahoo widgets, but I'm learning.
    This stopped working for some reason.  However the CFDebug consistently shows the subject event happening on every mouse click.  I'd rather just use that.  Any ideas?

    Roy, have you tried to reduce the complexity of your user case?
    Try your use case with a simple page without a region in it first and see if you get the eating them. If yes add a region to your page and verify you get the result you expect. Only then add the portal stuff.
    This will help to narrow down the error.
    Timo

  • How to Handle Events for JOptionPane buttons?

    Hi All,
    I need a help...
    I am trying to develop a simple SWING application that consists of multiple elements (mainly text fields) and a Submit button. On pressing Submit button, it should validate all the fields and then do something else. But if some fields are left blank, then it should give a pop-up message and on clicking the OK button on the pop-up message, the focus should go to that text field which is left null.
    The problem is I am not able to understand how to Capture this OK button click-event of the pop-up message. I mean how to do something when the OK/Cancle button of the pop-up window is clicked.
    Please Help me.
    Thanks in Advance,
    Ujjal

    As already pointed out, JOptionPane has some static methods which show a dialog, and return an int, or a string. The whole point of this class is to remove the need for any event handling by the developer, that is, you simply call the showDialog method or whatever, and it returns a value telling you, for example, which button was pressed - no need for action listeners at all. The result of the showDialog method (or whichever you use) tells you which button was pressed. Check the javadocs for JOptionPane for details of several constants that indicate which button was pressed
    The class exists to make simple dialogs trivial to generate - you're overcomplicating things!

  • Check box Handling in ALV Tree Control

    Hi All,
    I am implementing a scenario wherein which I need to get the checked items and process upon the user action. In the implementation I am not getting the checked values.
    This is how I have implemented.
    I have added a check box field in the Field catalog which is type c
    * Item Layout for the Check box.
      lwa_item_layout-fieldname = 'CHKBOX'.
      lwa_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
      lwa_item_layout-editable = 'X'.
      APPEND lwa_item_layout TO lt_item_layout.
    After that I have tried to used this code to get the checked items.
       CALL METHOD tree1->get_checked_items
              IMPORTING
                et_checked_items = t_checked.
    But I am not getting any values in the table.
    Further I have tried to use the Event  <b>checkbox_change</b> for the check box logic( I am not sure but I thought it is)
    But the event is not triggering with this... Please Help me in this regard...

    CLASS cl_toolbar_event_receiver DEFINITION.
        PUBLIC SECTION.
    *      DATA: checked TYPE c,
    *            fieldname TYPE lvc_fname,
    *            node_key TYPE lvc_nkey.
          METHODS: on_function_selected
                     FOR EVENT function_selected OF cl_gui_toolbar
                       IMPORTING fcode.
          METHODS: handle_check_box_change
          FOR EVENT checkbox_change OF cl_gui_alv_tree
          IMPORTING checked
                    fieldname
                    node_key.
      ENDCLASS
    Does this Implementation giving any problem for this?

Maybe you are looking for

  • Printer on & connected but will not print

    I have a HP Photosmart 6525 all in one printer.   I have a HP Pavilion TouchSmart 23 all in one computer.   At one time i had the wireless as well as the USB cord set up to print items.   not sure when or what happened but i am unable to print now. 

  • Indesign CS4 task bar windows are inactive

    I am using Indesign CS4 with Windows 7.  The tool bars in Indesign are inactive and won't allow me to select options from them.  Is there possibly a compatability problem with Windows 7 or is it something else that could be conflicting.  I'd apprecia

  • Creating XML dynamically

    Hi, I need to create XML which follows this exact structure: <root>     <node>         <row>             <item>item01</item>             <item>item02</item>         </row>         <row>             <item>item03</item>             <item>item04</item>

  • Pls help. How to import Vedio purchased from Itune to Vision

    Kindly advise on how can I import all Vedios purchased from Itune to Vision M?. Thanks

  • Samsung 840 Evo incredibly slow in MacBook Pro 2011

    I just got a brand new 250GB Samsung 840 Evo SSD and put it in my MacBook Pro. The drive is incredibly slow. OS X install took hours, and it takes over a minute to boot up. Even small tasks like clicking a button take several seconds to process. I ha