JTree changing Icons of leaves of a node

I have a Jtree with root node as "Project"
I have nodes as "color", "sports", "food" which in turn have leaves.
I have to set an Icon "Icon1" for all the leaves of node "color"
I have to set another Icon "Icon2" for all leaves of node "sports"
and have to set another Icon3" for all the leaves of node "food"
How do I go about doing it? Thanks.

Take a look at the Swing Tutorial, specifically http://web2.java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display. This gives a straightforward example of changing icons (or anything on the node) by using a cell renderer.

Similar Messages

  • Change icon of a non selected node in JTree

    Hello
    I have a swing application contening a JTree.
    I'd like to know how to change the icon of a non selected node in my tree. I have the information about the node and its path. I try to change userObject information and the icon of the node with the setIcon of (DefaultMutableTreeNode), and reload the node (DefaultTreeModel) but it doesn't work.
    Do I have to set the change in my CellRenderer ?
    Any advice will be welcome
    Anne

    If you carefully look at the java tutorial tree, the change is made for all the leaf icon. What I want is to change the icon of a not selected node of my tree while I do other stuff with the other nodes like select, display their contents, drag them ...
    the operation of a not selected node is independant from the selection in the tree.
    So I still ask how to force a node to reload and take care of the change of his icon.
    Anne

  • How to change icons of a JTree node dynamically

    Hi all!
    I want to change icon associated with a node dynamically ( i.e. after the tree has being displayed). How can i achieve this?
    Can any one provide me a sample code snippet.
    Thanks in advance
    Murali

    I have created CustomCellRenderer and i'm calling this class as follows
    tree.setCellRenderer((TreeCellRenderer) new CustomCellRenderer(true));
    The boolean value for the constructor (in this case it's true) will be set to
    a local variable in the CustomCellRenderer class. Then upon clicking a node in the tree the boolean value (true) is set and the icon for that node should be changed as specified in the CustomCellRenderer class.
    When i click on a node all the icons of that tree are disappearing.
    Can any one help me in this issue
    public class CustomCellRenderer
              extends          JLabel
              implements     TreeCellRenderer
    private ImageIcon          grayfolderImage;
    private ImageIcon          greenfolderImage;
    private ImageIcon          bluefolderImage;
    private ImageIcon          redfolderImage;
    private ImageIcon          whitefolderImage;
    private boolean               bSelected;
    boolean logfileDeleted;
         public CustomCellRenderer()
              grayfolderImage = new ImageIcon("C:\\images\\grayFolder.gif");     
              greenfolderImage = new ImageIcon("C:\\images\\greenFolder.gif");     
              bluefolderImage = new ImageIcon("C:\\images\\blueFolder.gif");     
              redfolderImage = new ImageIcon("C:\\images\\redFolder.gif");
              whitefolderImage = new ImageIcon("C:\\images\\whiteFolder.gif");     
         public CustomCellRenderer(boolean logfileDeleted){
              this.logfileDeleted = logfileDeleted;
         public Component getTreeCellRendererComponent( JTree tree,
                             Object value, boolean bSelected, boolean bExpanded,
                                       boolean bLeaf, int iRow, boolean bHasFocus )
              // Find out which node we are rendering and get its text
              DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
              String     labelText = (String)node.getUserObject();
              this.bSelected = bSelected;
              // Set the correct foreground color
              /*if( !bSelected )
                   setForeground( Color.black );
              else
                   setForeground( Color.red ); */
              // Determine the correct icon to display
              if( labelText.equals( "ioexception001" ) )
                   setIcon( redfolderImage );
              else if( labelText.equals( "ioexception002" ) )
                   setIcon( greenfolderImage );
              else if( logfileDeleted ==true )
                   setIcon( whitefolderImage );
              else if( labelText.equals( "ioexception004" ) )
                   setIcon( redfolderImage );
              else
                   setIcon(bluefolderImage);
              // Add the text to the cell
              setText( labelText );
              return this;
         // This is a hack to paint the background. Normally a JLabel can
         // paint its own background, but due to an apparent bug or
         // limitation in the TreeCellRenderer, the paint method is
         // required to handle this.
         public void paint( Graphics g )
              Color          bColor;
              Icon          currentI = getIcon();
              // Set the correct background color
              bColor = bSelected ? SystemColor.textHighlight : Color.white;
              g.setColor( bColor );
              // Draw a rectangle in the background of the cell
              g.fillRect( 0, 0, getWidth() - 1, getHeight() - 1 );
              super.paint( g );
    }

  • Cannot change icon UI property on node in hGrid's tree

    Hi,
    I created region of style hGrid (ID HGridRN).
    Under HGridRN I created region of style tree (ID TreeRN).
    Under TreeRN I have members and I want to set some dynamic property for nodeDef2 member.
    HGridRN
    __TreeRN
    ____members
    ______nodeDef1
    ______childNode1
    ________nodeDef2 <- I want dynamic icon on this node
    ________childNode2
    I try to use next sequence of statements:
    OAHGridBean hGridBean = (OAHGridBean)webBean.findIndexedChildRecursive("HGridRN");
    OAWebBean treeBean = hGridBean.findChildRecursive("TreeRN");
    *if (treeBean != null) {*
    *..OATreeDefinitionBean nodeDef2 = (OATreeDefinitionBean)treeBean.findChildRecursive("nodeDef2");*
    *..nodeDef2.setAttributeValue(ICON_ATTR, new OADataBoundValueViewObject(nodeDef2, "NodeIconAttr", "ComplectVO1"));*
    Setting ICON_ATTR attribute doesn't change the icon in hgrid.
    If fact I can even write nodeDef2.setRendered(false); but the node still exists in UI.
    How to get reference to nodeDef2?
    Edited by: user12086842 on 02.01.2013 5:51

    Hi,
    It looks like, that yout context node V_HOME.1 has no elements ( = no data ), try to fill your context node by some data ( by supply method for example). Or you can try change cardinality of your V_HOME.1 node to 1..n.
    Regards Jiri

  • JTree leaf icon

    Hi,
    I am doing a sort of explorer, with a JTree.
    I know how to change icons for leafs, but sometimes my leafs are indeed branches but without nothing in it (an empty directory).
    so the tree displays it as a leaf. But I would like that the tree displays it with the directory icon (but without the "+" sign).
    How can i do this ?
    Sylvain.

    I haven't such problems...
    Ok. You have to create your custom TreeCellRenderer and set it to the tree.
    IconRenderer myRenderer=new IconRenderer ();
    tree.setCellRenderer(myRenderer);
    class IconRenderer extends JLabel implements TreeCellRenderer
    public Component getTreeCellRendererComponent(JTree tree,
              Object value, boolean sel, boolean expanded, boolean leaf,
              int row, boolean hasFocus)
    setText(value.toString());
    //process value (value represents you tree node content)
    if (!leaf) {
    if (expanded)
    setIcon(new ImageIcon("images/expanded.gif"));
    else
    setIcon(new ImageIcon("images/collapsed.gif"));
    else {
    setIcon(new ImageIcon("images/text.gif"));
    MyObject myObj=(MyObject)value;
    if (myObj.isBranch()) {
    setIcon(new ImageIcon("images/branch.gif"));
    regards
    Stas

  • Change abesnt to leave in ESS portal 7.3

    Hi Experts,
    We are using Portal 7,3 version,my requirment is we need to change the absent to leave in Working Time ->create leave request-
    >Calender tab. here we need to change absent to leave.
    we know the followning information.
    Component: HRESS_C_LEA_EMP_CALENDAR
    Window: W_MAIN
    View: V_EMP_CALENDAR
    Application Component: PA-ESS-XX-WDA
    Please help me where can i modify name in ESS.
    Thanks in advance.
    Thanks and Regards,
    Vanitha

    Hi,
    enhance the above mentioned method, in Overwrite exit paste the below code.
    method _OVR_9PSJM003IJB4KOVKXYXOVKO32 . "Exit of LOAD_CALENDAR_DATA (in ZHR_TEST )
    * Call the function module and read the calendar data for the user
      DATA: lt_eecale_data  TYPE ptarq_uia_eecale_tab,
            lv_begda        TYPE sy-datum,
            lv_month_x      TYPE i,
            lv_month_y      TYPE i,
            lt_legend       TYPE ptreq_uia_legend_tab,
            lt_commands     TYPE ptarq_uia_command_tab,
            lt_messages     TYPE ptarq_uia_messages_tab.
      DATA: ls_eecale_data  LIKE LINE OF lt_eecale_data,
            ls_legend       LIKE LINE OF lt_legend.
      DATA  lv_application_mode TYPE pt_arq_mode.
      CALL METHOD wd_comp_controller->go_communicator->ret_application_mode
        RECEIVING
          rv_pt_arq_mode = lv_application_mode.
      IF lv_application_mode IS INITIAL. " Fallback implementation:
        lv_application_mode = cl_pt_req_const=>c_role_employee.
      ENDIF.
    *  Begin of Jain_1661953
    DATA: wda_ec TYPE flag.
          wda_ec = 'x'.
         EXPORT wda_ec FROM wda_ec TO MEMORY ID 'WDA_EC_FLG'.
    *  End of Jain_1661953
    * Call the function module to Read the Employee data in a particular period
      CALL FUNCTION 'PT_ARQ_EECALE_GET'
        EXPORTING
          im_command           = iv_command
          im_pernr             = wd_this->gv_pernr
          im_time_format       = '1'
          im_modus             = lv_application_mode
          im_eecale_start_date = iv_start_date
          im_deactivate_check  = abap_true
    *     IM_DEBUG             =
        IMPORTING
          ex_eecale_data       = lt_eecale_data
          ex_begda             = lv_begda
          ex_month_x           = lv_month_x
          ex_month_y           = lv_month_y
        TABLES
          ex_legend            = lt_legend
          ex_commands          = lt_commands
          ex_messages          = lt_messages.
    ************ To Change the legend text *************
      LOOP AT lt_legend INTO ls_legend where TEXT = 'Absent'.
        ls_legend-text = 'Leave'.
        modify lt_legend from ls_legend transporting text.
      endloop.
    * Update the data returned by the FM into the corresponding Context nodes:
    * Update the markings in the Calendar:
      DATA: BEGIN OF ls_calemarking,
              date      TYPE d,
              semantics TYPE wdui_table_cell_design,
              tooltip   TYPE string,
            END OF ls_calemarking.
      DATA lt_calemarking     LIKE TABLE OF ls_calemarking.
      DATA lo_nd_calemarking  TYPE REF TO if_wd_context_node.    "Ref to series_node
      DATA lt_request         TYPE ptreq_uia_request_id_tab.
      DATA ls_request         TYPE ptreq_uia_request_id_struc.
      LOOP AT lt_eecale_data INTO ls_eecale_data.
        ls_calemarking-date = ls_eecale_data-reqdate.
        ls_calemarking-semantics = wd_this->conv_table_cell_design( iv_legendid = ls_eecale_data-legendid ).
    *   Read tooltip information
        lt_request = ls_eecale_data-request[].
        CLEAR ls_calemarking-tooltip.
        LOOP AT lt_request INTO ls_request.
          IF ls_calemarking-tooltip IS INITIAL. " First loop execution
            ls_calemarking-tooltip   = ls_request-tooltip.
          ELSE.
            CONDENSE ls_calemarking-tooltip.
            CONCATENATE ls_calemarking-tooltip ls_request-tooltip INTO ls_calemarking-tooltip SEPARATED BY ', '.
          ENDIF.
        ENDLOOP.
        APPEND ls_calemarking TO lt_calemarking.
      ENDLOOP.
    * Read the personal work schedule and mark the Off Days and Public Holidays in the calendar.
      DATA: lv_begin_date TYPE datum,
            lt_psp TYPE ptpsp_tab,
            ls_psp TYPE ptpsp.
      lv_begin_date = iv_start_date.
      lv_begin_date+6(2) = '01'.
    * Temporary buffering required for monthly navigation of the Datenavigator instead of the default quarterly:
      wd_this->gv_begin_date = lv_begin_date.
      lt_psp = wd_this->read_work_schedule(
          iv_begda = lv_begin_date ).
      LOOP AT lt_psp INTO ls_psp WHERE stdaz EQ 0.
        CLEAR ls_calemarking.
        ls_calemarking-date = ls_psp-datum.
        ls_calemarking-semantics = '20'. " CALENDARMETAL
        ls_calemarking-tooltip = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_ESS_WDA_OTR/NON_WORKDAY' ).
        APPEND ls_calemarking TO lt_calemarking.
      ENDLOOP.
      LOOP AT lt_psp INTO ls_psp WHERE ftkla NE 0.
        CLEAR ls_calemarking.
        ls_calemarking-date = ls_psp-datum.
        ls_calemarking-semantics = '17'. " TWO.
    *   Read Public Holiday information:
        ls_calemarking-tooltip = cl_hress_ptarq_tim_services=>get_public_holiday_description(
                                     iv_pernr = wd_this->gv_pernr
                                     iv_date = ls_psp-datum ).
        IF ls_calemarking-tooltip IS INITIAL.
          ls_calemarking-tooltip = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_ESS_WDA_OTR/NON_WORKDAY' ).
          ls_calemarking-semantics = '20'.
        ENDIF.
        APPEND ls_calemarking TO lt_calemarking.
      ENDLOOP.
    * Setting the value of Context CalenderMarking...
      lo_nd_calemarking = wd_context->get_child_node( name = 'CALENDARMARKINGS' ).
      CALL METHOD lo_nd_calemarking->bind_table
        EXPORTING
          new_items = lt_calemarking.
    * Setting the value of Context CalendarData
      DATA: lo_nd_cale_data  TYPE REF TO if_wd_context_node.
      DATA: BEGIN OF ls_cale_data,
              selection_begda TYPE d,
              selection_endda TYPE d,
              startswith      TYPE d,
              monthspercol    TYPE i,
              monthsperrow    TYPE i,
            END OF ls_cale_data.
      lo_nd_cale_data = wd_context->get_child_node( name = 'CALENDARDATA' ).
      IF iv_selection_begda IS NOT INITIAL."IS SUPPLIED.
        ls_cale_data-selection_begda = iv_selection_begda.
      ELSE.
        ls_cale_data-selection_begda = sy-datum.
      ENDIF.
      IF iv_selection_endda IS NOT INITIAL. "IS SUPPLIED.
        ls_cale_data-selection_endda = iv_selection_endda.
      ELSE.
        ls_cale_data-selection_endda = sy-datum.
      ENDIF.
      ls_cale_data-startswith      = lv_begda.
      ls_cale_data-monthsperrow    = lv_month_x.
      ls_cale_data-monthspercol    = lv_month_y.
      lo_nd_cale_data->bind_structure( new_item = ls_cale_data ).
    * Setting the Legend Context Node
      DATA lo_nd_calelegend  TYPE REF TO if_wd_context_node.
      DATA: BEGIN OF ls_calelegend,
              legendid    TYPE ptreq_uia_legend_struc-legendid,
              category    TYPE wdui_table_cell_design,
              legendtext  TYPE string,
            END OF ls_calelegend.
      DATA: lt_calelegend LIKE TABLE OF ls_calelegend,
            lv_legendid TYPE string.
      LOOP AT lt_legend INTO ls_legend.
        ls_calelegend-legendid   = ls_legend-legendid.
        ls_calelegend-legendtext = ls_legend-text.
        lv_legendid = ls_legend-legendid.
        ls_calelegend-category   = wd_this->conv_table_cell_design( iv_legendid = lv_legendid ).
        APPEND ls_calelegend TO lt_calelegend.
      ENDLOOP.
    *  Append the legends for Non-Working days and Public Holidays:
      ls_calelegend-legendid   = 'CALENDARMETAL'.
      ls_calelegend-legendtext = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_ESS_WDA_OTR/NON_WORKDAY' ).
      ls_calelegend-category   = '20'.
      APPEND ls_calelegend TO lt_calelegend.
      CLEAR ls_calelegend.
      ls_calelegend-legendid   = 'TWO'.
      ls_calelegend-legendtext = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_ESS_WDA_OTR/PUBLIC_HOLIDAY' ).
      ls_calelegend-category   = '17'.
      APPEND ls_calelegend TO lt_calelegend.
      lo_nd_calelegend = wd_context->get_child_node( name = 'LEGEND' ).
      CALL METHOD lo_nd_calelegend->bind_table
        EXPORTING
          new_items = lt_calelegend.
    endmethod.
    Regards,
    Jyothi

  • Folder icon display at richfaces tree node

    Hello All,
    I would like to use richfaces tree structure.
    But the issue with that is the folder icon display at each tree node.
    For some reason i don't want the folder icon at the tree node.
    Is there anyway to get rid of that?
    I tried to change the image (iconFolder.gif) to some 1X1 pixel image in the richfaces jar file.
    But when i added the new jar with new image for icon, that image is not loading.
    I'm using Jboss4.2 as my application server.
    Please help me to remove the folder display at tree node.
    Thanks in advance.
    Regards,
    Elizabath

    Hi,
    I could see the icon attribute to specify the folder icon at the node. I placed a 1x1 pixel image as the iconfolder image. But that results in a blank pixel at the node. I wish to get rid of that.
    Also i wanted to change the navigation images too. i would like to have the + and - sign images instead of arrows.
    Any suggestions?

  • NM changes icons

    Yes, I checked the forum and saw lots of comments about NM changing Icons. Well I uninstalled NM from all machines but it appears that NM uninstaller leaves a lot of junk. I reinstalled it after I turned off all my other machines and to my supprise it showed all the machines that were turned off and the one with the incorrect Icon. Well if all the other machines were turned off I would suppose that they should not show in the map.
    I am stumped and guess it was a poor idea to install NM and expect it to show correctly.
    Thanks Any way
    Frank
    Kenmore, WA
    Solved!
    Go to Solution.

    Well hows this. When I starter up my system (2 workstations, 2 cameras, 1 server and one wireless device) all reported correctly by NM. Its as if the entire system reverted back to the orginial systerm and my first installation of NM. I have changed nothing in the system or NM.
    Bugs or gremlins in the software?
    Frank

  • Add change Icon in the Table Control tool bar.

    Hi Abapers,
    I need to add "change" icon in the table control. I added it but when I click on it is not working.
    My requirement is that when I run my custom report, all the fields should be shown is in display mode. Then when I click on the "change" icon, all fields should be enabled for change.
    I have already referred to the standard progs BCALV_* but it does not have the "change" icon.
    plz give me any reference prg or sample code.
    Thanks
    Nani.

    Hi Nani,
    Track the function code of change icon in user command. if it is clicked then put a flag eq X.
    check that flag in PBO, if it is eq X then screen-input = 1 or vice versa.
    try this code:
    in PBO:
    LOOP AT SCREEN
    IF WS_EDIT = 'X'
    SCREEN-INPUT = 1
    ELSE
    SCREEN-INPUT = 0
    ENDIF
    MODIFY SCREEN
    ENDLOOP
    Hope it will work fine
    Regards
    Krishnendu

  • How to change icon of a Folder-track?

    By Folder-track I mean the Folder in Arrange window that is created from "packing reions". Is that even possible in LogicPro7 - to change it's icon?
    I mean I know how to change icons for my audio tracks, audio-instrument tracks. And it would be nice if I can assign different icons for different Folder-tracks.
    I did not find how to do that

    It is possible... use option-command-hold on the icon of the folder in a track in the arrange and up pops the many icons to choose from.
    You can set the icon to something other than the folder.
    To make different folders I guess you would have to do some image editing
    and make your own icons but that is pretty easy.
    Put your user create icons here...
    ~/Library/Application Support/Logic/Images/Icons
    and logic will load your numbered image file instead of the default ones that
    Logic would normaly use.
    Note: 1.png is the file name of the regular folder icon.

  • Change icon for file type

    how to change icon for all of the tile type? not just one, but all!

    Changing the file icon will not enable Quicktime to play Matroska files. Changing the file suffix might.
    It could be a 'difficult' form of Matroska file. FYI Matroska is just a container like MOV or AVI, and some mkv have the video encoded with Real Video Codec (RV9 RV10). Perian+QT can't decode this, but VLC will play .mkv files just fine on OS X, as long as they don't use H.264!
    It's a bit of a lottery until Matroska decide to support the Apple platform. I have found this:
    http://mkv4mac.free.fr/index.php?lang=en&p=lec
    which may help.
    But there may be another workaround: 1. Get Info the mkv file
    2. Change to extension to wmv. Save as wmv and that could work better.
    Or this link may be helpful:
    http://www.squidoo.com/mkv-converter-mac
    Recently, a poster (ZachP14) suggested this:
    "There's a program called Plex that runs .mkv files awesome on my 2.0 ghz macbook."
    http://www.plexapp.com/
    Maybe worth a try?
    More information here:
    ttp://en.wikipedia.org/wiki/Matroska

  • Change Icon missing in the existing SC in ITS URL

    Hi Gurus
    User is trying to change some details in existing SC, user is able to find the SC in Check status and clicked the details button   it will display the document item details, but the Change Icon is missed for the user.
    Until last week, user was able to make changes before the cart was approved, also I verified the change details in SU01D, and nothing has been changed.
    Also I verified my user ID in testing client, I am able to see the change Icon .
    Please advice
    Thanks & Regards
    Sada

    Hi,
    Please check the value of the parameter BBP_WFL_SECURITY  in trascn PFCG for the EMPLOYEE role. See whether that is set to value  low/medium/high so that the employee sees the CHANGE button.
    BR,
    Disha.
    Do reward points for  useful answers.

  • Trouble changing icon in any application, file, etc etc

    I've followed the instructions to change an icon and have done it before with success. But it's not working anymore? Here are the steps i'm doing.... Am I missing something?
    1. right click on icon that i want to use as the "new icon"
    (i believe this is the problem... preview.app is opening the icon. with in get info, the "icon" at the top is just your generic "jpeg" icon. In the "preview" window towards the bottom shows a picture of the icon)
    2. select get info
    3. right click on "icon" at top of preview window
    4. cmd c to copy (also tried copy from file drop down)
    5. repeated step on target app to chang icon
    6. cmnd v to paste (also tried to paste from file drop down)
    doesn't change the icon on the target app or file etc etc....
    signed.... confused?

    OK, try doing both a SMC and PRAM reset and see if either takes care of the problem.
    iMac
    SMC & PRAM Resets
    There are a couple of things you can do before heading off to the Apple store, a SMC and PRAM resets. To do these:
    _SMC RESET_
    • Shut down the computer.
    • Unplug the computer's power cord and all peripherals.
    • Press and hold the power button for 5 seconds.
    • Release the power button.
    • Attach the computers power cable.
    • Press the power button to turn on the computer.
    _PRAM RESET_
    • Shut down the computer.
    • Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    • Turn on the computer.
    • Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    • Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    If it still doesn't work then try restarting in Safe Mode, this will clear out some caches which have become corrupted. http://support.apple.com/kb/HT1455

  • Changing Preferred Language leaves Mail.app's FLAGS menu showing the last non-English language

    After changing the System's Preferred Language to FRANCAIS, then back again to BRITISH ENGLISH, I've found that the FLAGS menu of MAIL.APP will not change back to ENGLISH.
    e.g.
    - I change the Preferred Language setting to FRANCAIS,
    - I restart Mail.app.
    - I change the Preferred Language setting to BRITISH ENGLISH
    - I restart Mail.app.
    The Flags menu is still in FRANCAIS. Every other menu is using the correct language
    - I then change the Preferred Language to ESPANOL
    - I restart Mail.app
    - I change the Preferred Language setting to BRITISH ENGLISH
    The Flags Menu is now in ESPANOL.
    It seems I can change the FLAGS menu to anything other than ENGLISH or BRITISH ENGLISH.
    Rebooting between changes and/or leaving Mail.app open or closed seems to make no difference.
    It's quite annoying as I make extensive use of keyboard shortcuts to flag emails....!
    Any clues?

    I should point out that every other menu is changing correctly to reflect the Preferred Language. It is just the FLAGS menu that is not changing to english.

  • Error when I change the visibility of a context node

    Hi,
    I had to change the visibility of a context node (ZActivityH) to public (it was private) in the context to access it in the method DO_HANDLE_EVENT. I used transaction BSP_WD_WORKBENCH. I verify and activate it.
    As a result of changing the visibility, I have this error:
    Class      CX_SY_REF_IS_INITIAL
    Text:      Dereferencing of the NULL reference
    Program:      ZL_CRM_IC_IRECREASON_IMPL=====CP
    Include:      ZL_CRM_IC_IRECREASON_IMPL=====CM00C
    Source Text Row:      8
    The new source code in method DO_HANDLE_EVENT is:
    DATA category TYPE STRING.
    category = ztyped_context->ZActivityH->GET_CATEGORY( ATTRIBUTE_PATH = '' ).
    Any idea about the problem? Can I modify the visibility of a context node?
    Thank you very much for your help.
    María José

    Thanks a lot, Patrick,
    My context node is null, but I don´t know why.
    I have:
    In Class: ZL_CRM_IC_IRECREASON_IMPL
    Attribute ZTYPED_CONTEXT     type ref ZL_CRM_IC_IRECREASON_CTXT
    In class: ZL_CRM_IC_IRECREASON_CTXT
    Attribute ZACTIVITYH      type ref ZL_CRM_IC_IRECREASON_CN10
    In class: ZL_CRM_IC_IRECREASON_CN10
    Method GET_CATEGORY
    In method CREATE_CONTEXT_NODES:
    model = owner->create_model(
          class_name     = 'ZL_CRM_IC_IRECREASON_CN10'
          model_id       = 'ActivityH' ).                       "#EC NOTEXT
      activityh ?= model.
    In view I’m filling the context node:
    Regards,
    María.

Maybe you are looking for