How to make a Tree Node invisible?

Hi
I have got a JTree where I have created a DefaultTreeModel and a DefaultTreeCellRenderer. The JTree is filled to data from data base. These nodes after are used to do querys to a data base. But when in tree's level 2 has got only a child, this node I want to set like not visible. because this node i need it do querys.
I have found a thread to explain something:
http://forum.java.sun.com/thread.jsp?forum=57&thread=126031
a) A kind to do, it is so
I make a new Class extends DefaultTreeCellRenderer, but it doesn't work, the code is here
public class SegnalarNodoRender extends DefaultTreeCellRenderer {
  public SegnalarNodoRender() {
  public Component getTreeCellRendererComponent(JTree tree, Object value,
                                                boolean sel, boolean expanded, boolean leaf,
                                                int row, boolean hasFocus) {
           Component comp;
          DefaultMutableTreeNode nodo = (DefaultMutableTreeNode) value;
          DefaultMutableTreeNode padreNodo = (DefaultMutableTreeNode) nodo.getParent();
           if (leaf && sel)  {
             return super.getTreeCellRendererComponent(tree,value,sel,
                                                       expanded,leaf,row,hasFocus);}
           else
             if (!leaf && nodo.getLevel()==2 && padreNodo.getChildCount()==1 ) {
             //Set not visible
               this.setVisible(false);
               return  super.getTreeCellRendererComponent(tree, value, false,
                                                         expanded, leaf, row, hasFocus);
             else {
               return super.getTreeCellRendererComponent(tree, value, false,
                                                         expanded, leaf, row, hasFocus);
}b) the anoher kinds it explains how to make it. It is extended a class from DefaultTreeModel, But it is in this function the this class(botton), where I don't know how the node sets to invisible. Why NodoPadre hasn't any function to set invisible.
public Object getChild(Object parent, int index) {
  // DefaultMutableTreeNode NodoPadre = (DefaultMutableTreeNode) parent;
  // TreeNode p;
  // p = NodoPadre.getParent();
   return parent;
}I hope somebody can help me.
thanks in advanced.

Hi,
I have the same problem and would realy like to know how to do this´, using ADF Faces 11G with the up to date JDeveloper.
I've found some blog entries in the web showing how to do this with a POJO-based approach. They insert Data programmatically based on a view object's result set, reading all data and inserting the data to the POJO.
However, I like to
1) Drag-And-Drop the data-control (based on one master and one details - view object and a view link) to a page and add it as tree table
2) Get the folder icon only displayed when there are children
3) get the last child (=leaf) displayed without folder icon.
To make this possible, we should somehow extend the TreeModel Class and override the function isContainer
@Override
public boolean isContainer() {
  if (getRowData() != null) {
     MyRowImpl value = (MyRowImpl) getRowData();
    if (value.getChildValues() != null &&
       value.getChildValues().size() > 0) {
      return true;
    return false;
}Can somehow please give me a hint how to extend the tree model base class (What class?) and how to get the framework to use this model class?
Maybe there is a sample application for 11g somewhere?
Thanks,
Stefan
Edited by: Stefan1979 on 04.11.2009 18:10

Similar Messages

  • How to get a Tree Node Value when a Tree is Expanded

    My reqiurement is when i Expand a Tree i need the Expanded tree Node Value. For Example Consider Parent as a Root Node of a Tree, and Consider its two Children Child1 and Child2.
    When + Parent Expanded
    I will Get the Output as --Parent
    - Child1
    - Child2
    so As when i expand the Tree i must Get the String Value Parent.

    duplicate
    How to get a Tree Node Value when a Tree is Expanded

  • How to make the tree sibling nodes sorting  in memory per the VO default?

    Hi,
    I have a question on the uncommitted tree nodes sorting. The tree was built using the same VO with the view link to itself (parent/child relation). I have defined a default sorting on my VO. Now if I insert a node to the tree, the sibling nodes may not sort correctly if it is not committed. I tried to insert it to the RowsetIterator at the right position, it seems OK. but when you right click or something that make the tree to refresh, the order will mess up. If I do an auto save after each action, everything looks OK. But the fusion pattern is to do a global save, I have to manipulate the tree with the uncommitted data. I know I can set the view object's SQL mode to do the in-memory sorting. But not sure if it works on the tree structure, because it is not a single RowsetIteroator.. Can someone give an advice? Many thanks.
    Edited by: user736572 on Jan 20, 2012 2:48 PM

    Thanks Sudipto for trying to help. I did try that, and as I mentioned in the previous posting, it doesn't work for the tree nodes (multiple RowSetIterator). the following is my code, where the treeVO is the vo instance for the firstLevel tree nodes and it has view link to its children. I am not sure how to sort all children for each level. Even for the first level where I did the explicit sorting in memory, it still not sorting at all.
    treeVO.setSortBy("code");
    treeVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS|ViewObject..QUERY_MODE_SCAN_DATABASE_TABLES);
    treeVO.executeQuery();

  • How to make the leaf node of the APEX tree downloadable

    Hi All,
    I am trying to build a "library" page for my application, with the documents as the leaf nodes of the tree. The documents come from a database table, and each document is a BLOB.
    My question is, how should I write the "link" part of the APEX tree query to make the lead node document downloadable for the end users?
    Thanks,
    Christine

    Hilary helped me out of this by creating a new form page with two new items there corresponding to the PK and BLOB column, then in the tree query use apex_util.get_blob_file_src function as the link. Below is the email from Hilary:
    1. Created Form, page 13, based upon your table storing the documents as BLOBs. The form page has just two associated items: P13_DOC and P13_DOC_ID. The item P13_DOC is of type FILE and contains a source type of DB column, which is the first required parameters of the function get_blob_file_src. NOTE: I could have created a form region on the same page as your tree, but chose to generate a separate page. You may choose to change this yourself.
    2. Updated the Tree query on pg 12 to use the following link for tree nodes of level 4:
    apex_util.get_blob_file_src('P13_DOC',v.attr3)
    ...where P13_DOC is the application page item mentioned in step 1 above, and v.attr3 should hold the unique ID associated with the document. Your tree now allows users to download the listed documents.

  • How to hide a tree node from the GUI but still keep it in the tree model?

    Hi, All
    I used a JTree in my project in which I have a DefaultTreeModel to store all the tree structure and a JTree show it on the screen. But for some reason, I want to hide some of the nodes from the user, but I don't want to remove them from the tree model because later on I still need to use them.
    I searched on the web, some people suggested method to hide the root node, but that's not appliable to my project because I want to hide some non-root nodes; Some people also suggested to collapse the parent node when there are child to hide, it is not appliable to me either, because there still some other childnodes (sibling of the node to hide) I want to show.
    How can I hide some of the tree node from the user? Thanks for any information.
    Linda

    Here's an example using a derivation of DefaultTreeModel that shows (or does not show) two types of Sneech (appologies to the good Dr Zeus) by overiding two methods on the model.
    Now, there are many things wrong with this example (using instanceof, for example), but it's pretty tight and shows one way of doing what you want.
    Note: to make it useful, you''d have to change the implementation of setShowStarBelliedSneeches() to do something more sophisticated than simply firing a structure change event on the root node. You'd want to find all the star bellied sneech nodes and call fireTreeNodesRemoved(). That way the tree would stay expanded rather than collapse as it does now.
    import javax.swing.JTree;
    import javax.swing.JScrollPane;
    import javax.swing.JOptionPane;
    import javax.swing.JCheckBox;
    import javax.swing.JPanel;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.DefaultMutableTreeNode;
    import java.awt.Dimension;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Enumeration;
    class FilteredTree
         private class PlainBelliedSneech {
              public String toString() { return "Plain Bellied Sneech"; }
         private class StarBelliedSneech {
              public String toString() { return "Star Bellied Sneech"; }
         private class FilteredTreeModel
              extends DefaultTreeModel
              private boolean mShowStarBelliedSneeches= true;
              private DefaultMutableTreeNode mRoot;
              FilteredTreeModel(DefaultMutableTreeNode root)
                   super(root);
                   mRoot= root;
              public Object getChild(Object parent, int index)
                   DefaultMutableTreeNode node=
                        (DefaultMutableTreeNode) parent;
                   if (mShowStarBelliedSneeches)
                        return node.getChildAt(index);
                   int pos= 0;
                   for (int i= 0, cnt= 0; i< node.getChildCount(); i++) {
                        if (((DefaultMutableTreeNode) node.getChildAt(i)).getUserObject()
                                            instanceof PlainBelliedSneech)
                             if (cnt++ == index) {
                                  pos= i;
                                  break;
                   return node.getChildAt(pos);
              public int getChildCount(Object parent)
                   DefaultMutableTreeNode node=
                        (DefaultMutableTreeNode) parent;
                   if (mShowStarBelliedSneeches)
                        return node.getChildCount();
                   int childCount= 0;
                   Enumeration children= node.children();
                   while (children.hasMoreElements()) {
                        if (((DefaultMutableTreeNode) children.nextElement()).getUserObject()
                                            instanceof PlainBelliedSneech)
                             childCount++;
                   return childCount;
              public boolean getShowStarBelliedSneeches() {
                   return mShowStarBelliedSneeches;
              public void setShowStarBelliedSneeches(boolean showStarBelliedSneeches)
                   if (showStarBelliedSneeches != mShowStarBelliedSneeches) {
                        mShowStarBelliedSneeches= showStarBelliedSneeches;
                        Object[] path= { mRoot };
                        int[] childIndices= new int[root.getChildCount()];
                        Object[] children= new Object[root.getChildCount()];
                        for (int i= 0; i< root.getChildCount(); i++) {
                             childIndices= i;
                             children[i]= root.getChildAt(i);
                        fireTreeStructureChanged(this, path, childIndices, children);
         private FilteredTree()
              final DefaultMutableTreeNode root= new DefaultMutableTreeNode("Root");
              DefaultMutableTreeNode parent;
              DefaultMutableTreeNode child;
              for (int i= 0; i< 2; i++) {
                   parent= new DefaultMutableTreeNode(new PlainBelliedSneech());
                   root.add(parent);
                   for (int j= 0; j< 2; j++) {
                        child= new DefaultMutableTreeNode(new StarBelliedSneech());
                        parent.add(child);
                        for (int k= 0; k< 2; k++)
                             child.add(new DefaultMutableTreeNode(new PlainBelliedSneech()));
                   for (int j= 0; j< 2; j++)
                        parent.add(new DefaultMutableTreeNode(new PlainBelliedSneech()));
                   parent= new DefaultMutableTreeNode(new StarBelliedSneech());
                   root.add(parent);
                   for (int j= 0; j< 2; j++) {
                        child= new DefaultMutableTreeNode(new PlainBelliedSneech());
                        parent.add(child);
                        for (int k= 0; k< 2; k++)
                             child.add(new DefaultMutableTreeNode(new StarBelliedSneech()));
                   for (int j= 0; j< 2; j++)
                        parent.add(new DefaultMutableTreeNode(new StarBelliedSneech()));
              final FilteredTreeModel model= new FilteredTreeModel(root);
              JTree tree= new JTree(model);
    tree.setShowsRootHandles(true);
    tree.putClientProperty("JTree.lineStyle", "Angled");
              tree.setRootVisible(false);
              JScrollPane sp= new JScrollPane(tree);
              sp.setPreferredSize(new Dimension(200,400));
              final JCheckBox check= new JCheckBox("Show Star Bellied Sneeches");
              check.setSelected(model.getShowStarBelliedSneeches());
              check.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        model.setShowStarBelliedSneeches(check.isSelected());
              JPanel panel= new JPanel(new BorderLayout());
              panel.add(check, BorderLayout.NORTH);
              panel.add(sp, BorderLayout.CENTER);
              JOptionPane.showOptionDialog(
                   null, panel, "Sneeches on Beeches",
                   JOptionPane.DEFAULT_OPTION,
                   JOptionPane.PLAIN_MESSAGE,
                   null, new String[0], null
              System.exit(0);
         public static void main(String[] argv) {
              new FilteredTree();

  • How to make column tree the ALV

    As in normal table we can make column tree by using  'TreeByNestingTableColumn' property, can any one tell me how to do the same in alv.
    I have used set_hierarchy_column( abap_true ), but i was not able to map all the elements with in a node to other columns present in the alv table.
    requirement:
    Column 1            Column 2
    P1                        value 1
    ->C1                    value 2
        -> C11              value 3
        -> C12              value 4
    ->C2                    value 5
        -> C21              value 6
        -> C22              value 7
    P2                        value 8
    Can some please tell me how to do it.
    Thanks
    Abhishek

    Can some one please help me!!
    I need to implement column tree in web dynpro application using ALV

  • How to create Hierarchy Tree Node structure?

    Hi experts,
              I want to know how to create a tree with kind of below Structure:
    Root A
             NodeA1
                  ITEMA1_IT1
                  ITEMA1_IT2
                  ITEMA1_IT3
             NodeA2
                  ITEMA2_IT1
                  ITEMA2_IT2
             NodeA3
                  ITEMA3_IT1
                  ITEMA3_IT2
                  ITEMA3_IT3
                  ITEMA3_IT4
    So when i click on Root A it shows me, NODEA1, NODEA2 & NODEA3....
    when further i click on NODEA1, it shows me items like  ITEMA1_IT1,ITEMA1_IT2, ITEMA1_IT3.
    when further i click on NODEA2, it shows me items like  ITEMA2_IT1,ITEMA2_IT2.
    SO item will get loaded when i click on perticular node.
    how its possible.
    I have gone through SDN so many threads, bt i didn't get exactly for webdynpro ABAP.
    Please guide me for the same.
    Thanks ,
    Saurin Shah

    Hi,
    you can create the tree you wanted as follows:
    1) create a node under your context say "root_node" with cardinality 1..1
    2) now create an attribute under it called "text" with type string.
    3) now create three nodes under this "root_node" called nodeA1 nodeA2 and nodeA3 with cardinality 0..n
    4) now under nodeA1 , nodeA2 and nodeA3 create an attribute called "text" with type string...so each node will have one attribute called "text" of type string...
    5) now create a node under nodeA1 called "itemA1" with cardinlity 0..n
    6) now create an attribute called "text" of type string under this node "itemA"...
    7) repeat step 5 and 6 for the other two nodes...nodeA2 and nodeA3
    8) now create six supply functionsthese functions will supply the text values for your nodes-
    I created like this:
    FILL_ITEM1
    FILL_ITEM2
    FILL_ITEM3
    FILL_NODEA1
    FILL_NODEA2
    FILL_NODEA3
    Note:*******************my view is called MAIN******************
    hence the coding is
    data
        lt_elements type if_main=>elements_nodea1.
    if you view is called view1...than the data declaration would be
    data
        lt_elements type if_view1=>elements_nodea1.
    9) go to each node and assign the supply function respectively....you can assign this by going to context tab and selecting the node you want to assign the supply function to and just type in the name of the supply funciton or do the help for that field by clicking on the little square btn...
    10) now we go the layout tab and put the tree ui on the layout....bind the datasource property to the context node "root_node"
    and bind the rootText property to the attribute "text" of the root_node...
    11) now right click on this tree ui element under the ROOTUIELEMENTCONTAINER and select "insert node type" ...a box will appear where you can see it has two types of node for you....one is tree_node_type and other one is tree_item_type...
    create three nodes with tree_node_type with names "nodeA1" nodeA2 and nodeA3 and three with tree_item_type with names "itemA1" itemA2 and itemA3...
    12) now bind all these node types and item types data sources and texts with corresponding nodes and attributes under your context...
    so nodeA1datasource will get bind to context nodeA1 and itemA1 data source will get bind to itemA1 from context..and so on...
    13) now in the wddoinit method: I setup the text for the root node.....
    DATA lo_nd_root_node TYPE REF TO if_wd_context_node.
      DATA lo_el_root_node TYPE REF TO if_wd_context_element.
      DATA ls_root_node TYPE wd_this->element_root_node.
      DATA lv_root_txt TYPE wd_this->element_root_node-root_txt.
    navigate from <CONTEXT> to <ROOT_NODE> via lead selection
      lo_nd_root_node = wd_context->get_child_node( name = wd_this->wdctx_root_node ).
    get element via lead selection
      lo_el_root_node = lo_nd_root_node->get_element( ).
    @TODO fill attribute
    lv_root_txt = 'Root Node'.
    set single attribute
      lo_el_root_node->set_attribute(
        name =  `ROOT_TXT`
        value = lv_root_txt ).
    hope this will give you the solution you are looking for...
    Thanks...
    AS...........

  • How to make a block as invisible at SSCRN Output ?

    Hello All,
            I have 3 Blocks on my SSCRN and  I have 2 Radio Buttons.
    I want to make 2 Blocks as Invisible when one of the radio button is selected.
    Can any one tell me how to do so ?
    Regards,
    Deepu.K

    Hi,
    See the 2 sample codes for doing this and do accordingly
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,
    pa_lifnr TYPE lfa1-lifnr MODIF ID abc,
    pa_vkorg TYPE vbak-vkorg MODIF ID abc.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
    SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
    s_date FOR gs_lfa1-erdat MODIF ID def,
    s_augru FOR gs_vbak-augru MODIF ID def,
    s_vbeln FOR gs_vbak-vbeln MODIF ID def.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *
    SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *
    SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b3.
    IF pa_rep EQ gc_x.
    LOOP AT SCREEN.
    IF screen-group1 = gc_abc.
    screen-input = gc_zero_num.
    ELSEIF screen-group1 = gc_def.
    screen-active = gc_one_num.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ELSEIF pa_upd EQ gc_x.
    *For Reprocessing
    LOOP AT SCREEN.
    IF screen-group1 = gc_def.
    screen-input = gc_zero_num.
    ELSEIF screen-group1 = gc_abc.
    screen-active = gc_one_num.
    ENDIF.
    MODIFY SCREEN.
    CLEAR pa_upd.
    ENDLOOP.
    ENDIF.
    REPORT zrich_001.
    PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
                            user-command chk,
                p_rad2 RADIOBUTTON GROUP grp1.
    SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
                    s_datum2 FOR sy-datum MODIF ID d2.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_rad1 = 'X'
          AND screen-group1 = 'D2'.
          screen-active = '0'.
        ENDIF.
        IF p_rad2 = 'X'
         AND screen-group1 = 'D1'.
          screen-active = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    reward if sueful
    regards,
    ANJI

  • How to highlight a tree node programmatically

    Problem
    =====
    Just like a typical management software, I have a navigation tree presenting a list of objects (let's say toasters) on the left panel. The content panel on the right side presents the details of a toaster, when the user selects the toaster on the navigation tree. On the toaster details panel, I would like to have a hyper link referring to another toaster - associated to the selected toaster. On clicking on the hyperlink, I would like to display the details of the associated toaster and the navigation tree node for the associated toaster being highlighted.
    For example, BUI presents the following now:
    + Toasters | Toaster 1 Details [Refresh]
    + <toaster1> |
    + toaster2 | ... toaster3
    + toaster3 |
    toaster1 is selected on the navigation tree. The contents panel displays Toaster 1 details, which has a hyper link for toaster3.
    When the user click on toster3 on the contents panel, I would like to see the following
    + Toasters | Toaster 3 Details [Refresh]
    + toaster1 |
    + toaster2 | ...
    + <toaster3> |
    My Trial
    =====
    ADF Rich Client 11.1.2.3 is used for my development.
    Jspx code for the navigation tree looks like this:
    <af:tree id="navTree" ...>
    <f:facet name="nodeStamp">
    <af:panelGroupLayout id="nodePgl">
    <af:switcher facetName="#{stamp.outcome!=null?'actnode':'noactnode'}" ...>
    <f:facet name="actnode">
    <af:commandLink id="leafLink" text="#{stamp.label}" action="#{stamp.actionOutcome}">
    <af:setActionListener from="#{stamp.key}" to="#{treeHandler.selectedMenuItem}"/>
    </af:commandLink>
    </f:facet>
    <f:facet name="noactnode">
    <af:outputText id="notLeafText" value="#{stamp.label}"/>
    </f:facet>
    </af:switcher>
    </af:panelGroupLayout>
    </f:facet>
    </af:tree>
    The hyper link on the contents panel looks like this:
    <af:iterator var="toaster" value="#{toastData.toasters}">
    <af:commandLink text="#{toaster}" action="#{toasterHandler.goToToaster}">
    <f:param name="toasterId" value="#{toaster}"/>
    <af:setActionListener from="#{toaster}" to="#{treeHandler.selectedToaster}"/>
    </af:commandLink>
    </af:iterator>
    I got some tips from this forum (cannot find thread at the moment) and implemented the treeHandler.selectedToaster method as follows:
    // getSelectionState returns selStat, which is instantiated like the following:
    // RowKeySet selStat = new RowKeySetTreeImpl();
    // TreeModel model = (TreeModel) menuModel.getWrappedData();
    // selStat.setCollectionModel(model);
    // selStat.setContained(true);
    RowKeySet rowKeySet = getSelectionState();
    rowKeySet.removeAll();
    // synthesize the rowKey for the selected toaster
    // if the toaster found in the toaster node list,
    // rowKey should look like [0, <rowIdx of toaster>]
    ArrayList<Integer> rowKey = new ArrayList<Integer>();
    rowKey.add(0);
    rowKey.add(new Integer(rowIdx));
    TreeModel model = (TreeModel) menuModel.getWrappedData();
    model.setRowKey(rowKey);
    model.setRowIndex(rowIdx);
    rowKeySet.add();
    This seems to work most of times except when I refresh the contents details panel using partial page rendering.
    I get NullPointerException on the call to rowKeySet.removeAll().
    Caused by: java.lang.NullPointerException
         at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._selectAll(RowKeySetTreeImpl.java:459)
         at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.removeAll(RowKeySetTreeImpl.java:146)
    In my observation, this NPE happens when rowKeySet.size() returns 1 but rowKeySet.iterator() does not return any entries.
    I suspect this is a bug on RowKeySetTreeImpl but not sure.
    Help Need
    =======
    1. What is the reasonably right way to highlight the tree node for my problem?
    2. If my trial is one way to do it, how can I get around the NPE? I cannot change ADF Rich Client library at this point.
    Any help/suggestion/advise would be appreciated.
    Thanks,
    Jeongtae

    I did this, to programmatically expand a tree node, you can try the same and set the row key to highlight.
    private RowKeySet disclosedTreeRowKeySet = new RowKeySetImpl();
    public void rowDisclosureListener(RowDisclosureEvent rowDisclosureEvent)
    Iterator added = rowDisclosureEvent.getAddedSet().iterator();
    if (added!=null)
    while (added.hasNext())
    Object rowKey = added.next();
    //disclosedTreeRowKeySet.clear();
    List path = (List)rowKey;
    for( int i=0; i< path.size(); i++ )
    List<Object> nodePath = new ArrayList<Object>();
    for( int j=0; j<i; j++ )
    nodePath.add( path.get( j ) );
    disclosedTreeRowKeySet.add( nodePath );
    disclosedTreeRowKeySet.add( rowKey );
    System.out.println( "disclosed Keys...... " + disclosedTreeRowKeySet );
    private void expandSelectedNode(RowKeySet addedObj) {
    if (sourceTreeTable != null) {
    Iterator added = (Iterator)addedObj.iterator();
    if (added!=null)
    while (added.hasNext())
    Object rowKey = added.next();
    List path = (List)rowKey;
    for( int i=0; i< path.size(); i++ )
    List<Object> nodePath = new ArrayList<Object>();
    for( int j=0; j<i; j++ )
    nodePath.add( path.get( j ) );
    disclosedTreeRowKeySet.add( nodePath );
    disclosedTreeRowKeySet.add( rowKey );
    sourceTreeTable.setDisclosedRowKeys(disclosedTreeRowKeySet);
    }

  • How to make a tree and Use of CL_GUI_SIMPLE_TREE?

    Hi All,
         I am working on a module pool. I want to create a tree like thing. In ABAPDOCU  and SE84 Tn we have a tree on the left hand side. I need to make a tree in a similar way. Can someone tell me how to achieve this and what is the use of the class CL_GUI_SIMPLE_TREE and its methods NODE_SEL_MODE_SINGLE and ADD_NODES. Can anyone provide me some simple sample coding?
    Any help will be appreciated.

    also read the class documentation
    CL_GUI_SIMPLE_TREE

  • How do we get tree node infomation in an App Engine

    I want to write an app engine to get accounts that are under various tree nodes. How do I write this in an App Engine.. I just need help getting started

    you can use start with connect by clause in a SQL step to link data in a hierarchy
    something on the lines of :
    +SELECT     *+
    FROM pstreenode
    WHERE setid = '<YourSetID>'
    AND tree_name = '<YourTreeName>'
    AND EFFDT='<YourEFFDT>'
    START WITH tree_node = '<Tree Node for which you wish to find all the child nodes>'
    CONNECT BY PRIOR tree_node = parent_node_name

  • How to display the tree nodes distinctivly.

    Hay all,
    Frnds , i am facing a problem. I have created a tree whose each node consisted of a checkbox and a label. For that i have used DefaultMutableTreeNodes for tree nodes and a TreeCellRenderer. Is there any method or way to display some nodes distinctively(may be in different color or something else). Plz tell me soon its very urgent.

    Hi Jürgen,
    See http://help.sap.com/saphelp_nw04/helpdata/en/44/6aaf92f5a23672e10000000a114a6b/frameset.htm
    Only Worksets and Roles are not described, anyhow, doing a bit research via decompiling or just by searching on SDN will bring you the needed extra info; just as an example for roles access: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401
    Hope it helps
    Detlev

  • How to make material number field invisible in MM60?

    Dear expert,
    Is there any way to make material number field invisible in MM60 for one user?
    Best regards

    Hello,
    You may create a transaction variant for MM60 and hide Material code using SHD0. Then create Variant group and assign users to this group.
    Thanks,
    Venu

  • How to copy & paste tree nodes

    Hello,
    Can i have an example that copies & pastes tree nodes?
    thank u.

    It is most probably be cause you are trying to select/deselect an already selected/deselected node programmatically, you need to be careful when using SELECT_ON/OFF if the node is already selected.
    The WHEN-TREE-NODE-SELECTED trigger fires also when a node is deselected, this where the problem exists with this error.
    Use the :SYSTEM..TRIGGER_NODE_SELECTED system variable to determine whether the node is being selected or deselected, it returns 'TRUE' when selected and 'FALSE' when deselected and change your code logic accordingly.
    Metalink Note:292050.1 clearly states the cause of this error
    Tony
    Edited by: Tony Garabedian on Aug 26, 2008 2:08 PM

  • How to select a tree node in JSF.

    Hi All,
    Sample code for JSF components having following lines to display a tree node:
    <d:graph_treenode name="File-New" label="New 5"
    icon="folder_16_pad.gif" action="demo-test.faces"/>
    The above lines are showing that when we select the node it is invoking "demo-test.jsp". Whether it is possible to select multiple nodes similar to JTree(Swing) functionality?
    Regards,
    Sharath Reddy.

    Hi again,
    I am sorry, I cannot help in another way than looking at the documentation, because I have currently no JDK available here. If expandPath(...) doesn't work, you can try to get all the nodes of that path and expand them from the root node downwards, perhaps that will work.
    greetings Marsian

Maybe you are looking for