Mitigating hidden nodes

Hi,
I have a problem with hidden nodes, in "the old days" i would use RST/CTS to try and mitigate the problem.
I don't see that option i the WLC.
Is the some other way to make adjustments in the WLC to mitigate problems with hidden nodes?
/Aksel

The overall ways to mitigate the " hidden node " are
Increasing Transmitting Power From the Nodes
Using Omnidirectional antennas
Removing obstacles
Moving the node
Using Antenna Diversity: MIMO technology , 802.11n

Similar Messages

  • Implemented hidden nodes, Expanded state inconsistent?!

    Hi Guys, I have a rather complex JTree problem.
    I have implemented my own custom tree and nodes, with a custom model that allows hidden nodes. My nodes have an isVisible() method that is used in the model to see whether to return this node (in the getChildCount and getChild methods). This works great, and means that I can apply a filter to the tree, and it will immediately filter out a certain type of node (without having to add/remove nodes).
    I have a bit of a problem when some nodes are expanded however. If I expand a node, then change the filters so that node is invisible, the node that takes it's place becomes expanded. This would be fine, but the expansion of the node does not fire an event (and in my program this causes problems!).
    I've written the code below to give a very simple example. Just run the code, expand the 'Red' node you can see, then press 'Toggle Red'. The red node then disappears, but the blue node that takes it's place is then expanded (this is what I need to stop, or at least make that expansion of the blue node fire an event).
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Enumeration;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.event.TreeExpansionEvent;
    import javax.swing.event.TreeExpansionListener;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreeNode;
    import com.talgentra.tallyman.util.properties.ApplicationProperties;
    import com.talgentra.tallyman.util.properties.VersionProperties;
    public class TreeTest extends JFrame {
         private boolean showRed = true;
         private boolean showBlue = true;
         private int expansionEvents = 0;
         private JTree tree = new JTree();
         public static void main(String[] args) throws Exception {
              VersionProperties.create(null);
              ApplicationProperties.createConfigurationInstance();
              new TreeTest();
         public TreeTest() throws Exception {
              this.setSize(200,200);
              this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              this.getContentPane().setLayout(new BorderLayout());
              // set up toggle button
              JButton toggle = new JButton("Toggle Red");
              toggle.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        showRed = !showRed;
                        tree.updateUI();
              // set up tree
              ColorNode root = new BlueNode();
              ColorNode r1 = new RedNode();
              ColorNode r11 = new RedNode();
              ColorNode r21 = new RedNode();
              ColorNode b2 = new BlueNode();
              ColorNode b12 = new BlueNode();
              ColorNode b22 = new BlueNode();
              root.add(r1);
              root.add(b2);
              r1.add(r11);
              r1.add(b12);
              b2.add(r21);
              b2.add(b22);
              tree.setModel(new MyTreeModel(root));
              tree.addTreeExpansionListener( new TreeExpansionListener() {
                   public void treeExpanded(TreeExpansionEvent event) {
                        System.out.println("TreeExpansionEvents fired: " + expansionEvents);
                   public void treeCollapsed(TreeExpansionEvent event) {}
              this.getContentPane().add(toggle, BorderLayout.NORTH);
              this.getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
              this.show();
         abstract class ColorNode extends DefaultMutableTreeNode {
              public ColorNode(Object o) {
                   super(o);
              public abstract boolean isVisible();
         class RedNode extends ColorNode {
              public RedNode() {
                   super("Red");
              public boolean isVisible() {
                   return showRed;
         class BlueNode extends ColorNode {
              public BlueNode() {
                   super("Blue");
              public boolean isVisible() {
                   return showBlue;
         class MyTreeModel extends DefaultTreeModel {
              public MyTreeModel(TreeNode root) {
                   super(root);
              public int getChildCount(Object parent) {
                   int childCount = 0;
                   for ( Enumeration e = ((TreeNode)parent).children(); e.hasMoreElements();) {
                        Object o = (Object) e.nextElement();
                        if (o instanceof ColorNode) {
                             ColorNode node = (ColorNode) o;
                             if ( node.isVisible() ) {
                                  childCount++;
                        } else {
                             childCount++;
                   return childCount;
              public Object getChild(Object parent, int index) {
                   DefaultMutableTreeNode node = (DefaultMutableTreeNode) parent;
                   DefaultMutableTreeNode child = null;
                   int count = 0;
                   for (int i=0; i<node.getChildCount(); i++) {
                        // if this is not a ColorNode, or is a VISIBLE ColorNode then include it
                        if (!(node.getChildAt(i) instanceof ColorNode) || ((ColorNode) node.getChildAt(i)).isVisible()) {
                                  if ( count == index ) {
                                       child = (DefaultMutableTreeNode) node.getChildAt(i);
                                       break;
                                  } else {
                                       count++;
                   return child;
    }

    As always :) , I agree with Denis.
    This is what I've been doing in the mean time. The problem is that I get the opposite behavior. Re-added nodes are collapsed by default.import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.util.*;
    public class TreeTest extends JPanel {
         private static class Property {
              public static final Property PROPERTY_RED = new Property("red");
              public static final Property PROPERTY_BLUE = new Property("blue");
              private String theText;
              private boolean theState;
              private Property(String aText) {
                   theText = aText;
                   theState = true;
              public String toString() {
                   return theText;
              public void toggleState() {
                   theState = !theState;
              public boolean getState() {
                   return theState;
         private class ColorNode implements TreeNode {
              private ColorNode theParent;
              private Property theProperty;
              private Vector theChildren;
              private int[] theIndices;
              public ColorNode(Property aProperty) {
                   theParent = null;
                   theProperty = aProperty;
                   theChildren = new Vector();
                   theIndices = new int[]{};
              public void add(ColorNode aChild) {
                   theChildren.add(aChild);
                   aChild.theParent = this;
                   update();
              public String toString() {
                   return theProperty.toString();
              private boolean isVisible() {
                   return theProperty.getState();
              public int getChildCount() {
                   return theIndices.length;
              public boolean getAllowsChildren() {
                   return true;
              public boolean isLeaf() {
                   return theIndices.length == 0;
              public Enumeration children() {
                   Vector vector = new Vector();
                   for (int i = 0; i < theIndices.length; i++) {
                        vector.add(theChildren.elementAt(theIndices));
                   return vector.elements();
              public TreeNode getParent() {
                   return theParent;
              public TreeNode getChildAt(int childIndex) {
                   return (TreeNode)theChildren.elementAt(theIndices[childIndex]);
              public int getIndex(TreeNode node) {
                   for (int i = 0; i < theIndices.length; i++) {
                        if (theChildren.elementAt(theIndices[i]) == node) return theIndices[i];
                   return -1;
              private int getChange(Property aChangedProperty) {
                   if (theProperty != aChangedProperty) return 0;
                   if (theProperty.getState()) {
                        return 1;
                   } else {
                        return -1;
              public void update(Property aChangedProperty) {
                   Vector removedIndices = new Vector();
                   Vector removedObjects = new Vector();
                   for (int i = 0; i < theIndices.length; i++) {
                        ColorNode colorNode = (ColorNode)theChildren.elementAt(theIndices[i]);
                        if (colorNode.getChange(aChangedProperty) == -1) {
                             removedIndices.add(new Integer(theIndices[i]));
                             removedObjects.add(colorNode);
                   theTreeModel.nodesWereRemoved(this,
                                                      getIndexArray(removedIndices),
                                                      (Object[])removedObjects.toArray(new Object[removedObjects.size()]));
                   Vector vect = new Vector();
                   Vector added = new Vector();
                   for (int i = 0; i < theChildren.size(); i++) {
                        ColorNode colorNode = (ColorNode)theChildren.elementAt(i);
                        if (colorNode.isVisible()) {
                             vect.add(new Integer(i));
                             if (colorNode.getChange(aChangedProperty) == 1) {
                                  added.add(new Integer(i));
                             colorNode.update(aChangedProperty);
                   theIndices = getIndexArray(vect);
                   theTreeModel.nodesWereInserted(this, getIndexArray(added));
              private int[] getIndexArray(Vector someIndices) {
                   int[] indexArray = new int[someIndices.size()];
                   for (int i = 0; i < someIndices.size(); i++) {
                        indexArray[i] = ((Integer)someIndices.elementAt(i)).intValue();
                   return indexArray;
              public void update() {
                   Vector vect = new Vector();
                   for (int i = 0; i < theChildren.size(); i++) {
                        ColorNode colorNode = (ColorNode)theChildren.elementAt(i);
                        if (colorNode.isVisible()) {
                             vect.add(new Integer(i));
                   theIndices = getIndexArray(vect);
         private class ToggleStateAction extends AbstractAction {
              private Property theProperty;
              public ToggleStateAction(Property aProperty) {
                   super("Toggle " + aProperty.toString());
                   theProperty = aProperty;
              public void actionPerformed(ActionEvent e) {
                   theProperty.toggleState();
                   ((ColorNode)theTreeModel.getRoot()).update(theProperty);
         private DefaultTreeModel theTreeModel;
         private JTree theTree;
         public TreeTest() throws Exception {
              super(new BorderLayout());
              ColorNode root = new ColorNode(Property.PROPERTY_BLUE);
              ColorNode r1 = new ColorNode(Property.PROPERTY_RED);
              ColorNode r11 = new ColorNode(Property.PROPERTY_RED);
              ColorNode r21 = new ColorNode(Property.PROPERTY_RED);
              ColorNode b2 = new ColorNode(Property.PROPERTY_BLUE);
              ColorNode b12 = new ColorNode(Property.PROPERTY_BLUE);
              ColorNode b22 = new ColorNode(Property.PROPERTY_BLUE);
              root.add(r1);
              root.add(b2);
              r1.add(r11);
              r1.add(b12);
              b2.add(r21);
              b2.add(b22);
              root.update();
              theTreeModel = new DefaultTreeModel(root);
              theTree = new JTree(theTreeModel);
              add(new JScrollPane(theTree), BorderLayout.CENTER);
              JToolBar toolBar = new JToolBar();
              toolBar.setFloatable(false);
              toolBar.add(new ToggleStateAction(Property.PROPERTY_RED));
              toolBar.add(new ToggleStateAction(Property.PROPERTY_BLUE));
              add(toolBar, BorderLayout.NORTH);
         public static void main(String[] args) throws Exception {
              final JFrame frame = new JFrame("Test Tree");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setContentPane(new TreeTest());
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        frame.setSize(200, 200);
                        frame.show();

  • 802.11 RTS/CTS and hidden node problem

    Guys,
    A little confused here.
    The hidden node problem is if two nodes within a cell can hear the AP but not each other. OK.
    But, when we talk about 802.11b and 802.11g backwards compatibility causing reduced throughtput in terms of bandwidth, it seems that this is always blamed on 802.11g stations having to use RTS/CTS.
    But,
    Even in an 802.11g only cell, dont stations still have to use RTS/CTS mechanisms for the hidden node problem?
    I'm confused.com!
    Thx
    Ken

    When 802.11b clients are associated to an 802.11g access point, the access point will turn on a protection mechanism called Request to Send/Clear to Send (RTS/CTS). Originally a mechanism for addressing the "hidden node problem" , RTS/CTS adds a degree of determinism to the otherwise multiple access network. When RTS/CTS is invoked, clients must first request access to the medium from the access point with an RTS message. Until the access point replies to the client with a CTS message, the client will refrain from accessing the medium and transmitting its data packets. When received by clients other than the one that sent the original RTS, the CTS command is interpreted as a "do not send" command, causing them to refrain from accessing the medium. One can see that this mechanism will preclude 802.11b clients from transmitting simultaneously with an 802.11g client, thereby avoiding collisions that decrease throughput due to retries. One can see that this additional RTS/CTS process adds a significant amount of protocol overhead that also results in a decrease in network throughput.
    In addition to RTS/CTS, the 802.11g standard adds one other significant requirement to allow for 802.11b compatibility. In the event that a collision occurs due to simultaneous transmissions (the likelihood of which is greatly reduced due to RTS/CTS), client devices "back off" the network for a random period of time before attempting to access the medium again. The client arrives at this random period of time by selecting from a number of slots, each of which has a fixed duration. For 802.11b, there are 31 slots, each of which are 20 microseconds long. For 802.11a, there are 15 slots, each of which are nine microseconds long. 802.11a generally provides shorter backoff times than does 802.11b, which provides for better performance than 802.11a, particularly as the number of clients in a cell increases. When operating in mixed mode (operating with 802.11b clients associated) the 802.11g network will adopt 802.11b backoff times. When operating without 802.11b clients associated, the 802.11g network will adopt the higher-performance 802.11a backoff times.

  • Useful Code of the Day:  Hideable Tree Nodes

    Someone posted about how they could selectively hide tree nodes, and I already had this AbstractTreeModel class (which does some things DefaultTreeModel does and some it doesn't) and a concrete subclass for TreeNode objects, so I was thinking how one could do hideable nodes. So I came up with this solution.
    There's 4 classes here:
    - AbstractTreeModel is the base for the concrete TreeNodeTreeModel
    - TreeNodeTreeModel extends AbstractTreeModel to support TreeNodes (DefautlMutableTreeNode, etc.)
    - HideableMutableTreeNode which is a DefautlMutableTreeNode subclass which has a visible field (with is/set methods, of course).
    - HideableTreeModel is the hideable model which is a subclass of TreeNodeTreeModel.
    A HideableMutableTreeNode can be set invisible directly, but the tree still needs to be notified to update. So it's best to use the methods in HideableTreeModel which set a node's visibility which notify the tree of changes accordingly. Methods are also provided to check a full path's visibility or ensure a node including all parent nodes are visible.
    A HideableTreeModel can take any TreeNode class, it doesn't have to be all HideableMutableTreeNodes, but only HideableMutableTreeNodes can be made invisible, of course. Any other TreeNode type would just be considered visible.
    Hiding nodes works basically by making the tree think there's less nodes then there are. And to do this, the node counts and child index search just works by looping thru the parent's children. This has potential perfomance drawbacks of course, since one has to loop thru the node's children to get nodes every time. This could be alleviated by not supporting non-hideable nodes changing the internal maintenance of HideableMutableTreeNode contents. But I'll leave that to whoever really needs it. It shouldn't be a problem if there are are a relatively small set of child nodes in any given parent.
    Also, note that the root node in the model cannot be made invisible, cuz it'd be redundant since JTree can be set to hide the root node.
    // *** HideableTreeModel ***
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    * <code>HideableTreeModel</code> is an <code>TreeNodeTreeModel</code>
    * implementation for <code>HideableMutableTreeNode</code> objects.  The
    * model can also take any other <code>javax.swing.tree.TreeNode</code>
    * objects. 
    public class HideableTreeModel extends TreeNodeTreeModel {
          * Creates a new <code>HideableTreeModel</code> object.
          * @param  root  the root node
         public HideableTreeModel(TreeNode root) {
              super(root);
          * Checks if the specified node is visible.  A node can only be
          * hidden if the node is an instance of <code>HideableMutableTreeNode</code>.  <br />
          * <br />
          * Note that this only test the visibility of the specified node, not
          * whether a parent node is visible.  Use <code>isPathToNodeVisible(Object)</code>
          * to check if the full path is visible. 
          * @param  node  the node
          * @param  true if the node is visible, else false
         public boolean isNodeVisible(Object node) {
              if(node != getRoot()) {
                   if(node instanceof HideableMutableTreeNode) {
                        return ((HideableMutableTreeNode)node).isVisible();
              return true;
          * Sets the specified node to be hidden.  A node can only be made hidden
          * if the node is an instance of <code>HideableMutableTreeNode</code>.  <br />
          * <br />
          * Note that this method will notify the tree to reflect any changes to
          * node visibility.  <br />
          * <br />
          * Note that this will not alter the visibility of any nodes in the
          * specified node's path to the root node.  Use
          * <code>ensurePathToNodeVisible(Object)</code> instead to make sure the
          * full path down to that node is visible.  <br />
          * <br />
          * Note that this method will notify the tree to reflect any changes to
          * node visibility. 
          * @param  node  the node
          * @param  v     true for visible, false for hidden
          * @param  true if the node's visibility could actually change, else false
         public boolean setNodeVisible(Object node, boolean v) {
              // can't hide root
              if(node != getRoot()) {
                   if(node instanceof HideableMutableTreeNode) {
                        HideableMutableTreeNode n = (HideableMutableTreeNode)node;
                        // don't fix what ain't broke...
                        if(v != n.isVisible()) {
                             TreeNode parent = n.getParent();
                             if(v) {
                                  // need to get index after showing...
                                  n.setVisible(v);
                                  int index = getIndexOfChild(parent, n);
                                  super.nodeInserted(parent, n, index);
                             } else {
                                  // need to get index before hiding...
                                  int index = getIndexOfChild(parent, n);
                                  n.setVisible(v);
                                  super.nodeRemoved(parent, n, index);
                        return true;
              return false;
          * Checks if the specified node is visible and all nodes above it are
          * visible. 
          * @param  node  the node
          * @param  true if the path is visible, else false
         public boolean isPathToNodeVisible(Object node) {
              Object[] path = getPathToRoot(node);
              for(int i = 0; i < path.length; i++) {
                   if(!isNodeVisible(path)) {
                        return false;
              return true;
         * Sets the specified node and all nodes above it to be visible.
         * Note that this method will notify the tree to reflect any changes to
         * node visibility.
         * @param node the node
         public void ensurePathToNodeVisible(Object node) {
              Object[] path = getPathToRoot(node);
              for(int i = 0; i < path.length; i++) {
                   setNodeVisible(path[i], true);
         * Returns the child of parent at index index in the parent's child array.
         * @param parent the parent node
         * @param index the index
         * @return the child or null if no children
         public Object getChild(Object parent, int index) {
              if(parent instanceof TreeNode) {
                   TreeNode p = (TreeNode)parent;
                   for(int i = 0, j = -1; i < p.getChildCount(); i++) {
                        TreeNode pc = (TreeNode)p.getChildAt(i);
                        if(isNodeVisible(pc)) {
                             j++;
                        if(j == index) {
                             return pc;
              return null;
         * Returns the number of children of parent.
         * @param parent the parent node
         * @return the child count
         public int getChildCount(Object parent) {
              int count = 0;
              if(parent instanceof TreeNode) {
                   TreeNode p = (TreeNode)parent;
                   for(int i = 0; i < p.getChildCount(); i++) {
                        TreeNode pc = (TreeNode)p.getChildAt(i);
                        if(isNodeVisible(pc)) {
                             count++;
              return count;
         * Returns the index of child in parent.
         * @param parent the parent node
         * @param child the child node
         * @return the index of the child node in the parent
         public int getIndexOfChild(Object parent, Object child) {
              int index = -1;
              if(parent instanceof TreeNode && child instanceof TreeNode) {
                   TreeNode p = (TreeNode)parent;
                   TreeNode c = (TreeNode)child;
                   if(isNodeVisible(c)) {
                        index = 0;
                        for(int i = 0; i < p.getChildCount(); i++) {
                             TreeNode pc = (TreeNode)p.getChildAt(i);
                             if(pc.equals(c)) {
                                  return index;
                             if(isNodeVisible(pc)) {
                                  index++;
              return index;
         * Main method for testing.
         * @param args the command-line arguments
         public static void main(String[] args) {
              JFrame f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              HideableMutableTreeNode root = new HideableMutableTreeNode("root");
              root.add(new HideableMutableTreeNode("child_1"));
              final HideableMutableTreeNode c2 = new HideableMutableTreeNode("child_2");
              c2.setVisible(false);
              final HideableMutableTreeNode c2a = new HideableMutableTreeNode("child_2_A");
              c2.add(c2a);
              c2.add(new HideableMutableTreeNode("child_2_B"));
              root.add(c2);
              HideableMutableTreeNode c3 = new HideableMutableTreeNode("child_3");
              HideableMutableTreeNode cC = new HideableMutableTreeNode("child_3_C");
              cC.setVisible(false);
              c3.add(cC);
              c3.add(new HideableMutableTreeNode("child_3_D"));
              root.add(c3);
              root.add(new HideableMutableTreeNode("child_4"));
              root.add(new HideableMutableTreeNode("child_5"));
              DefaultMutableTreeNode c6 = new DefaultMutableTreeNode("child_6");
              c6.add(new DefaultMutableTreeNode("child_6_A"));
              c6.add(new DefaultMutableTreeNode("child_6_B"));
              root.add(c6);
              final HideableTreeModel model = new HideableTreeModel(root);
              JTree tree = new JTree(model);
              f.getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
              JButton b = new JButton("toggle");
              b.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        model.setNodeVisible(c2, !model.isNodeVisible(c2));
                        //model.ensurePathToNodeVisible(c2a);
              f.getContentPane().add(b, BorderLayout.SOUTH);
              f.pack();
              f.setSize(300, 500);
              f.show();
    // *** HideableMutableTreeNode ***
    import javax.swing.*;
    import javax.swing.tree.*;
    * <code>HideableMutableTreeNode</code> is a <code>DefaultMutableTreeNode</code>
    * implementation that works with <code>HideableTreeModel</code>.
    public class HideableMutableTreeNode extends DefaultMutableTreeNode {
         * The node is visible flag.
         public boolean visible = true;
         * Creates a tree node that has no parent and no children, but which
         * allows children.
         public HideableMutableTreeNode() {
              super();
         * Creates a tree node with no parent, no children, but which allows
         * children, and initializes it with the specified user object.
         * @param userObject - an Object provided by the user that
         * constitutes the node's data
         public HideableMutableTreeNode(Object userObject) {
              super(userObject);
         * Creates a tree node with no parent, no children, initialized with the
         * specified user object, and that allows children only if specified.
         * @param userObject - an Object provided by the user that
         * constitutes the node's data
         * @param allowsChildren - if true, the node is allowed to have child
         * nodes -- otherwise, it is always a leaf node
         public HideableMutableTreeNode(Object userObject, boolean allowsChildren) {
              super(userObject, allowsChildren);
         * Checks if the node is visible.
         * @return true if the node is visible, else false
         public boolean isVisible() {
              return this.visible;
         * Sets if the node is visible.
         * @param v true if the node is visible, else false
         public void setVisible(boolean v) {
              this.visible = v;
    // *** TreeNodeTreeModel ***
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    * <code>TreeNodeTreeModel</code> is an <code>AbstractTreeModel</code>
    * implementation for <code>javax.swing.tree.TreeNode</code> objects.
    public class TreeNodeTreeModel extends AbstractTreeModel {
         * Creates a new <code>TreeNodeTreeModel</code> object.
         * @param root the root node
         public TreeNodeTreeModel(TreeNode root) {
              super();
              setRoot(root);
         * Returns the parent of the child node.
         * @param node the child node
         * @return the parent or null if root
         public Object getParent(Object node) {
              if(node != getRoot() && (node instanceof TreeNode)) {
                   return ((TreeNode)node).getParent();
              return null;
         * Returns the child of parent at index index in the parent's child array.
         * @param parent the parent node
         * @param index the index
         * @return the child or null if no children
         public Object getChild(Object parent, int index) {
              if(parent instanceof TreeNode) {
                   return ((TreeNode)parent).getChildAt(index);
              return null;
         * Returns the number of children of parent.
         * @param parent the parent node
         * @return the child count
         public int getChildCount(Object parent) {
              if(parent instanceof TreeNode) {
                   return ((TreeNode)parent).getChildCount();
              return 0;
         * Returns the index of child in parent.
         * @param parent the parent node
         * @param child the child node
         * @return the index of the child node in the parent
         public int getIndexOfChild(Object parent, Object child) {
              if(parent instanceof TreeNode && child instanceof TreeNode) {
                   return ((TreeNode)parent).getIndex((TreeNode)child);
              return -1;
         * Returns true if node is a leaf.
         * @param node the node
         * @return true if the node is a leaf
         public boolean isLeaf(Object node) {
              if(node instanceof TreeNode) {
                   return ((TreeNode)node).isLeaf();
              return true;
         * Main method for testing.
         * @param args the command-line arguments
         public static void main(String[] args) {
              JFrame f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
              root.add(new DefaultMutableTreeNode("child_1"));
              DefaultMutableTreeNode c2 = new DefaultMutableTreeNode("child_2");
              c2.add(new DefaultMutableTreeNode("child_2_A"));
              c2.add(new DefaultMutableTreeNode("child_2_B"));
              root.add(c2);
              root.add(new DefaultMutableTreeNode("child_3"));
              root.add(new DefaultMutableTreeNode("child_4"));
              JTree tree = new JTree(new TreeNodeTreeModel(root));
              f.getContentPane().add(new JScrollPane(tree));
              f.pack();
              f.setSize(300, 500);
              f.show();
    // *** AbstractTreeModel ***
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.text.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    public abstract class AbstractTreeModel implements TreeModel {
         * The list of tree model listeners.
         private Vector modelListeners = new Vector();
         * The root object of the tree.
         private Object root = null;
         * Basic no-op constructor.
         public AbstractTreeModel() {
         * Gets the root object of the tree.
         * @return the root object
         public Object getRoot() {
              return this.root;
         * Sets the root object of the tree.
         * @param r the root object
         protected void setRoot(Object r) {
              this.root = r;
         * Gets the path to the root node for the specified object.
         * @param node the root node
         * @return the path to the object or <CODE>null</CODE>
         public Object[] getPathToRoot(Object node) {
              return getPathToRoot(node, 0);
         * Gets the path to the root node for the specified object.
         * @param node the root node
         * @param i the current index
         * @return the path to the object or <CODE>null</CODE>
         private Object[] getPathToRoot(Object node, int i) {
              Object anode[];
              if(node == null) {
                   if(i == 0) {
                        return null;
                   anode = new Object[i];
              } else {
                   i++;
                   if(node == getRoot()) {
                        anode = new Object[i];
                   } else {
                        anode = getPathToRoot(getParent(node), i);
                   anode[anode.length - i] = node;
              return anode;
         * Gets the parent object of the specified object. This method is not
         * part of the <code>javax.swing.tree.TreeModel</code> interface, but is
         * required to support the <code>getPathToRoot(Object)</code> method,
         * which is widely used in this class. Therefore, it is important to
         * correctly implement this method.
         * @param obj the object
         * @parma the parent object or null if no parent or invalid object
         protected abstract Object getParent(Object obj);
         * Adds a listener for the <CODE>TreeModelEvent</CODE> posted after the
         * tree changes.
         * @param l the tree model listener
         public void addTreeModelListener(TreeModelListener l) {
              modelListeners.addElement(l);
         * Removes a listener previously added with addTreeModelListener().
         * @param l the tree model listener
         public void removeTreeModelListener(TreeModelListener l) {
              modelListeners.removeElement(l);
         * Forces the tree to reload. This is useful when many changes occur
         * under the root node in the tree structure.
         * <b>NOTE:</b> This will cause the tree to be collapsed. To maintain
         * the expanded nodes, see the <code>getExpandedPaths(JTree)</code>
         * and <code>expandPaths(JTree, ArrayList)</code> methods.
         * @see #getExpandedPaths(JTree)
         * @see #expandPaths(JTree, ArrayList)
         public void reload() {
              reload(getRoot());
         * Forces the tree to repaint. This is useful when many changes occur
         * under a specific node in the tree structure.
         * <b>NOTE:</b> This will cause the tree to be collapsed below the
         * updated node.
         * @param node the node that changed
         public void reload(Object node) {
              if(node != null) {
                   TreePath tp = new TreePath(getPathToRoot(node));
                   fireTreeStructureChanged(new TreeModelEvent(this, tp));
         * Messaged when the user has altered the value for the item identified
         * by <CODE>path</CODE> to <CODE>newValue</CODE>.
         * @param path the path to the changed object
         * @param newValue the new value
         public void valueForPathChanged(TreePath path, Object newValue) {
              nodeChanged(path.getLastPathComponent());
         * Notifies the tree that nodes were inserted. The index is looked up
         * automatically.
         * @param node the parent node
         * @param child the inserted child node
         public void nodeInserted(Object node, Object child) {
              nodeInserted(node, child, -1);
         * Notifies the tree that nodes were inserted.
         * @param node the parent node
         * @param child the inserted child node
         * @param index the index of the child
         public void nodeInserted(Object node, Object child, int index) {
              if(index < 0) {
                   index = getIndexOfChild(node, child);
              if(node != null && child != null && index >= 0) {
                   TreePath tp = new TreePath(getPathToRoot(node));
                   int[] ai = { index };
                   Object[] ac = { child };
                   fireTreeNodesInserted(new TreeModelEvent(this, tp, ai, ac));
         * Notifies the tree that nodes were removed. The index is required
         * since by this point, the object will no longer be in the tree.
         * @param node the parent node
         * @param child the removed child node
         * @param index the index of the child
         public void nodeRemoved(Object node, Object child, int index) {
              if(node != null && child != null && index >= 0) {
                   TreePath tp = new TreePath(getPathToRoot(node));
                   int[] ai = { index };
                   Object[] ac = { child };
                   fireTreeNodesRemoved(new TreeModelEvent(this, tp, ai, ac));
         * Notifies the tree that a node was changed.
         * @param node the changed node
         public void nodeChanged(Object node) {
              if(node != null) {
                   TreePath tp = new TreePath(getPathToRoot(node));
                   fireTreeNodesChanged(new TreeModelEvent(this, tp, null, null));
         * Fires "tree nodes changed" events to all listeners.
         * @param event the tree model event
         protected void fireTreeNodesChanged(TreeModelEvent event) {
              for(int i = 0; i < modelListeners.size(); i++) {
                   ((TreeModelListener)modelListeners.elementAt(i)).treeNodesChanged(event);
         * Fires "tree nodes inserted" events to all listeners.
         * @param event the tree model event
         protected void fireTreeNodesInserted(TreeModelEvent event) {
              for(int i = 0; i < modelListeners.size(); i++) {
                   ((TreeModelListener)modelListeners.elementAt(i)).treeNodesInserted(event);
         * Fires "tree nodes removed" events to all listeners.
         * @param event the tree model event
         protected void fireTreeNodesRemoved(TreeModelEvent event) {
              for(int i = 0; i < modelListeners.size(); i++) {
                   ((TreeModelListener)modelListeners.elementAt(i)).treeNodesRemoved(event);
         * Fires "tree structure changed" events to all listeners.
         * @param event the tree model event
         protected void fireTreeStructureChanged(TreeModelEvent event) {
              for(int i = 0; i < modelListeners.size(); i++) {
                   ((TreeModelListener)modelListeners.elementAt(i)).treeStructureChanged(event);
         * Records the list of currently expanded paths in the specified tree.
         * This method is meant to be called before calling the
         * <code>reload()</code> methods to allow the tree to store the paths.
         * @param tree the tree
         * @param pathlist the list of expanded paths
         public ArrayList getExpandedPaths(JTree tree) {
              ArrayList expandedPaths = new ArrayList();
              addExpandedPaths(tree, tree.getPathForRow(0), expandedPaths);
              return expandedPaths;
         * Adds the expanded descendants of the specifed path in the specified
         * tree to the internal expanded list.
         * @param tree the tree
         * @param path the path
         * @param pathlist the list of expanded paths
         private void addExpandedPaths(JTree tree, TreePath path, ArrayList pathlist) {
              Enumeration enum = tree.getExpandedDescendants(path);
              while(enum.hasMoreElements()) {
                   TreePath tp = (TreePath)enum.nextElement();
                   pathlist.add(tp);
                   addExpandedPaths(tree, tp, pathlist);
         * Re-expands the expanded paths in the specified tree. This method is
         * meant to be called before calling the <code>reload()</code> methods
         * to allow the tree to store the paths.
         * @param tree the tree
         * @param pathlist the list of expanded paths
         public void expandPaths(JTree tree, ArrayList pathlist) {
              for(int i = 0; i < pathlist.size(); i++) {
                   tree.expandPath((TreePath)pathlist.get(i));

    Hey
    I'm not trying to show anyone up here, but having just built a tree model for displaying an XML document in a tree, I thought this seemed like a neat exercise.
    I implemented this very differently from the @OP. I only have one class, HiddenNodeTreeModel. All the hidden node data is stored in the model itself in my class. The advantage of what I've created is it will work with any TreeModel. The disadvantage is that I think it's not going to be very scalable - the additional computing to get the number of child nodes and to adjust indexes is heavy. So if you need a scalable solution definitely don't use this.
    Anyway here you go
    HiddenNodeTreeModel.java
    ======================
    package tjacobs.ui.tree;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Iterator;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JTree;
    import javax.swing.event.TreeModelListener;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreeModel;
    import javax.swing.tree.TreePath;
    import tjacobs.ui.WindowUtilities;
    public class HiddenNodeTreeModel implements TreeModel {
         TreeModel mModel;
         ArrayList<Object> mHidden = new ArrayList<Object>();
         public HiddenNodeTreeModel (TreeModel model) {
              mModel = model;
         public void addTreeModelListener(TreeModelListener arg0) {
              mModel.addTreeModelListener(arg0);
         private ArrayList<Integer> getHiddenChildren(Object parent) {
              ArrayList<Integer> spots = new ArrayList<Integer>();
              Iterator _i = mHidden.iterator();
              while (_i.hasNext()) {
                   Object hidden = _i.next();
                   int idx = mModel.getIndexOfChild(parent, hidden);
                   if (idx != -1) {
                        spots.add(idx);
              return spots;
         public Object getChild(Object arg0, int index) {
              ArrayList<Integer> spots = getHiddenChildren(arg0);
              Collections.sort(spots);
              Iterator<Integer> _i = spots.iterator();
              while (_i.hasNext()) {
                   int num = _i.next();
                   if (num <= index) {
                        index++;
              return mModel.getChild(arg0, index);
         public int getChildCount(Object arg0) {
              ArrayList list = getHiddenChildren(arg0);
              System.out.println("size = " + list.size());
              return mModel.getChildCount(arg0) - list.size();
         public int getIndexOfChild(Object arg0, Object arg1) {
              int index = mModel.getIndexOfChild(arg0, arg1);
              ArrayList<Integer> spots = getHiddenChildren(arg0);
              Collections.sort(spots);
              Iterator<Integer> _i = spots.iterator();
              int toSub = 0;
              while (_i.hasNext()) {
                   int num = _i.next();
                   if (num <= index) {
                        toSub++;
              return index - toSub;
         public Object getRoot() {
              // TODO Auto-generated method stub
              return mModel.getRoot();
         public boolean isLeaf(Object arg0) {
              // TODO Auto-generated method stub
              return mModel.isLeaf(arg0);
         public void removeTreeModelListener(TreeModelListener arg0) {
              mModel.removeTreeModelListener(arg0);
         public void valueForPathChanged(TreePath arg0, Object arg1) {
              mModel.valueForPathChanged(arg0, arg1);
         public void hideNode(Object node) {
              if (node instanceof TreePath) {
                   node = ((TreePath)node).getLastPathComponent();
              mHidden.add(node);
         public void showNode(Object node) {
              mHidden.remove(node);
         public void showAll() {
              mHidden.clear();
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              DefaultMutableTreeNode A = new DefaultMutableTreeNode("A");
              DefaultMutableTreeNode B = new DefaultMutableTreeNode("B");
              DefaultMutableTreeNode C = new DefaultMutableTreeNode("C");
              DefaultMutableTreeNode D = new DefaultMutableTreeNode("D");
              DefaultMutableTreeNode E = new DefaultMutableTreeNode("E");
              DefaultMutableTreeNode F = new DefaultMutableTreeNode("F");
              A.add(B);
              B.add(C);
              B.add(D);
              B.add(E);
              E.add(F);
              DefaultTreeModel model = new DefaultTreeModel(A);
              final HiddenNodeTreeModel hmodel = new HiddenNodeTreeModel(model);
              final JTree tree = new JTree(hmodel);
              JFrame jf = new JFrame("HiddenNodeTreeModel Test");
              jf.add(tree);
              JMenuBar bar = new JMenuBar();
              jf.setJMenuBar(bar);
              JMenu menu = new JMenu("Options");
              bar.add(menu);
              final JMenuItem hide = new JMenuItem("Hide");
              final JMenuItem show = new JMenuItem("ShowAll");
              menu.add(hide);
              menu.add(show);
              ActionListener al = new ActionListener() {
                   public void actionPerformed(ActionEvent ae) {
                        if (ae.getSource() == hide) {
                             hmodel.hideNode(tree.getSelectionPath());
                             tree.updateUI();
                        else {
                             hmodel.showAll();
                             tree.updateUI();
              hide.addActionListener(al);
              show.addActionListener(al);
              jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              jf.setBounds(100,100,100,100);
              jf.setVisible(true);
    }

  • How to set the number of hidden layers for neural network?

     I am using "Multiclass Neural Network" to build a model. I can configure number of hidden nodes, iterations etc., but I couldn't find anything to configure number of hidden layers. How to configure the number of hidden layers in Azure ML?

    Here is the article describing it - https://msdn.microsoft.com/library/azure/e8b401fb-230a-4b21-bd11-d1fda0d57c1f?f=255&MSPPError=-2147217396
    Basically, you will have to use a custom definition script in Net# (http://azure.microsoft.com/en-us/documentation/articles/machine-learning-azure-ml-netsharp-reference-guide/)
    to create hidden layers and nodes per hidden layer

  • Rearranging Nodes in a JTree

    Hi all,
    I'm trying to imitate a bookmark folder, where users can rearrange their bookmarks by dragging a selected node to another location (in between nodes). Users can also drag a node to a folder node and it gets put in that folder node.
    I currently have a simple drag and drop tree already implemented that allows bookmarks to be dragged to a folder. However, I'm unsure on how to approach the rearranging of nodes. Any help would be great.
    Thanks!

    There is no room between tree node labels and I expect you'll spend a lot of hours to extend tree classes to create such a room.
    The user can drag D and drop it onto B and it logically means he want D to be a child of B like
    A
    |__B
    |  |_D
    |_Cjust like the Windows Exlporer does. Or you can play with insertion logic here.
    As an idea, you can create hidden(?) Drop-support nodes inbetween each actual node and dedicate insertion logic to them and their parent. You'll have to worry about many things like deny selection of hidden nodes etc.
    In any case, your life will become easier if you should not to worry about TreeModel while managing your nodes. This is what my .iseful library is for.
    Denis Krukovsky
    http://sourceforge.net/projects/dotuseful/

  • Control problem in trees using class

    Hi all i am creating tree structure using class method in that when i am creating only one node it is working properly but when i try to crate multiple nodes it is giving me dump my program is as follow.
    I search these on sdn and try the things but it still giving me same error.
    *& Report  ZIRPT_HR_TEST_SPLITTER_01
    report  zirpt_hr_test_splitter_01.
    tables : pa0001,t582s.
    select-options : p_pernr for pa0001-pernr no intervals.
    *       CLASS screen_init DEFINITION
    class screen_init definition create private.
      public section.
        class-methods init_screen.
        methods constructor.
      private section.
        data: splitter_h type ref to cl_gui_splitter_container,
        splitter_v type ref to cl_gui_splitter_container,
        picture type ref to cl_gui_picture,
        tree type ref to cl_gui_simple_tree,
         it_pa0001 type table of pa0001,
         it_pa0000 type table of pa0000.
        methods: fill_tree,
        fill_picture.
    endclass.                    "screen_init DEFINITION
    *       CLASS screen_handler DEFINITION
    class screen_handler definition.
      public section.
        methods: constructor importing container
        type ref to cl_gui_container,
        handle_node_double_click
        for event node_double_click
        of cl_gui_simple_tree
        importing node_key.
      private section.
        data: html_viewer type ref to cl_gui_html_viewer,
               it_pa0001 type table of pa0001,
               it_pa0000 type table of pa0000,
        list_viewer type ref to cl_gui_alv_grid.
        methods:
        fill_list importing pernr type pa0001-pernr
                           infty type t582s-infty.
    endclass.                    "screen_handler DEFINITION
    *       CLASS screen_init IMPLEMENTATION
    class screen_init implementation.
      method init_screen.
        data screen type ref to screen_init.
        create object screen.
      endmethod.                    "init_screen
      method constructor.
        data: events type cntl_simple_events,
        event like line of events,
        event_handler type ref to screen_handler,
        container_left type ref to cl_gui_container,
        container_right type ref to cl_gui_container,
        container_top type ref to cl_gui_container,
        container_bottom type ref to cl_gui_container.
        create object splitter_h
        exporting
        parent = cl_gui_container=>screen0
        rows = 1
        columns = 2.
        call method splitter_h->set_border
          exporting
            border = cl_gui_cfw=>false.
        call method splitter_h->set_column_mode
          exporting
            mode = splitter_h->mode_absolute.
        call method splitter_h->set_column_width
          exporting
            id    = 1
            width = 110.
        container_left = splitter_h->get_container( row = 1 column = 1 ).
        container_right = splitter_h->get_container( row = 1 column = 2 ).
        create object splitter_v
        exporting
        parent = container_left
        rows = 2
        columns = 1.
        call method splitter_v->set_border
          exporting
            border = cl_gui_cfw=>false.
        call method splitter_v->set_row_mode
          exporting
            mode = splitter_v->mode_absolute.
        call method splitter_v->set_row_height
          exporting
            id     = 1
            height = 160.
        container_top = splitter_v->get_container( row = 1 column = 1 ).
        container_bottom = splitter_v->get_container( row = 2 column = 1 ).
        create object picture
        exporting parent = container_top.
        create object tree
        exporting parent = container_bottom
        node_selection_mode =
        cl_gui_simple_tree=>node_sel_mode_single.
        create object event_handler
        exporting container = container_right.
        event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
        event-appl_event = ' '.
        append event to events.
        call method tree->set_registered_events
          exporting
            events = events.
        set handler event_handler->handle_node_double_click for tree.
        call method: me->fill_tree,
                     me->fill_picture.
         call method cl_gui_cfw=>flush.
      endmethod.                    "constructor
      method fill_picture.
        types pict_line(256) type c.
        data pict_tab type table of pict_line.
        data url(255) type c.
        data : file type rlgrap-filename value 'C:\Documents and Settings\sapgroup.NITCOWRL\My Documents\nitco.gif'.
        translate file to upper case.
    *CALL FUNCTION 'WS_UPLOAD'
    *EXPORTING
    *filename = file
    *filetype = 'BIN'
    *TABLES
    *data_tab = pict_tab.
        data query_table_wa type w3query.
        data query_table type table of w3query." OF like w3query occurs 1 with header line.
        data html_table type table of w3html."  like w3html occurs 1.
        data return_code type  w3param-ret_code.
        data content_type type  w3param-cont_type.
        data content_length type  w3param-cont_len.
        data pic_data type table of w3mime."  like w3mime occurs 0.
        data pic_size type i.
        refresh query_table.
        query_table_wa-name = '_OBJECT_ID'.
        query_table_wa-value = 'ENJOYSAP_LOGO'.
        append query_table_wa to query_table.
        call function 'WWW_GET_MIME_OBJECT'
          tables
            query_string        = query_table
            html                = html_table
            mime                = pic_data
          changing
            return_code         = return_code
            content_type        = content_type
            content_length      = content_length
          exceptions
            object_not_found    = 1
            parameter_not_found = 2
            others              = 3.
        if sy-subrc = 0.
          pic_size = content_length.
        endif.
        call function 'DP_CREATE_URL'
          exporting
            type     = 'image'
            subtype  = cndp_sap_tab_unknown
            size     = pic_size
            lifetime = cndp_lifetime_transaction
          tables
            data     = pic_data
          changing
            url      = url
          exceptions
            others   = 1.
    *IMPORT pict_tab = pict_tab FROM DATABASE abtree(pi) ID 'FLIGHTS'.
    *CALL FUNCTION 'DP_CREATE_URL'
    *EXPORTING
    *type = 'IMAGE'
    *subtype = 'GIF'
    *TABLES
    *data = pict_tab
    *CHANGING
    *url = url.
        call method picture->load_picture_from_url
          exporting
            url = url.
        call method picture->set_display_mode
          exporting
            display_mode = picture->display_mode_fit_center.
    *     CALL METHOD cl_gui_cfw=>flush.
      endmethod.                    "fill_picture
      method fill_tree.
        data: node_table type table of abdemonode,
        node type abdemonode.
    *data : it_pa0001 TYPE TABLE OF p0001,
        data :wa_pa0001 type pa0001,
              wa_pa0000 type pa0000,
              it_t582s type table of t582s,
              wa_t582s type t582s.
        types : begin of ttab,
                 itext type t582s-itext,
                 infty type t582s-infty,
                 pernr type p0001-pernr,
                 end of ttab.
        data : itab type table of ttab,
               wa_tab type ttab.
          field-symbols : <fs> like p_pernr.
          data : text1 type c.
        node-hidden = ' '.
        node-disabled = ' '.
        node-isfolder = 'X'.
        node-expander = ' '.
        select * from t582s
                 into corresponding fields of table it_t582s
                 where sprsl = sy-langu
                   and infty in ('0001','0000')."'0002','0006',
    *                         '0008','0015','0019').
        loop at it_t582s into wa_t582s .
          move-corresponding wa_t582s to wa_tab.
          node-node_key = wa_t582s-infty.
          clear node-relatkey.
          clear node-relatship.
          node-text = wa_t582s-itext.
          node-n_image = ' '.
          node-exp_image = ' '.
          append node to node_table.
          loop at p_pernr assigning <fs>.
            wa_tab-pernr = <fs>-low.
            append wa_tab to itab.
            clear p_pernr-low.
            node-node_key = <fs>-low.
            node-relatkey = wa_tab-infty.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
            node-text = <fs>-low.
            node-n_image = '@AV@'.
            append node to node_table.
          endloop.
    *        SELECT SINGLE * FROM pa0001 INTO wa_pa0001 WHERE pernr in p_pernr.
    *     WHEN '0000'.
    *        SELECT SINGLE * FROM pa0000 INTO wa_pa0000 WHERE pernr = p_pernr.
    *    wa_tab-pernr = wa_pa0000-pernr.
    *    endcase.
          clear : wa_tab,wa_pa0001,wa_pa0000.
        endloop.
    *node-hidden = ' '.
    *node-disabled = ' '.
    *node-isfolder = 'X'.
    *node-expander = ' '.
    *LOOP AT itab INTO wa_tab.
    *AT NEW infty.
    *node-node_key = wa_tab-infty.
    *CLEAR node-relatkey.
    *CLEAR node-relatship.
    *node-text = wa_tab-itext.
    *node-n_image = ' '.
    *node-exp_image = ' '.
    *APPEND node TO node_table.
    *ENDAT.
    *AT NEW pernr.
    * node-node_key = wa_tab-pernr.
    *node-relatkey = wa_tab-infty.
    *node-relatship = cl_gui_simple_tree=>relat_last_child.
    *node-text = wa_tab-pernr.
    *node-n_image = '@AV@'.
    *node-exp_image = '@AV@'.
    *ENDAT.
    *APPEND node TO node_table.
    *ENDLOOP.
        call method tree->add_nodes
          exporting
            table_structure_name = 'ABDEMONODE'
            node_table           = node_table.
    *    CALL METHOD cl_gui_cfw=>flush.
      endmethod.                    "fill_tree
    endclass.                    "screen_init IMPLEMENTATION
    *       CLASS screen_handler IMPLEMENTATION
    class screen_handler implementation.
      method constructor.
        create object: html_viewer exporting parent = container,
        list_viewer exporting i_parent = container.
      endmethod.                    "constructor
      method handle_node_double_click.
        data: infty type t582s-infty,
              pernr type pa0001-pernr.
        infty = node_key(4).
        pernr = node_key+4(8).
    *IF pernr IS INITIAL.
    *CALL METHOD: fill_html EXPORTING infty = infty,
    *html_viewer->set_visible EXPORTING visible = 'X',
    *list_viewer->set_visible EXPORTING visible = ' '.
    *ELSE.
        call method: fill_list exporting infty = infty
                                         pernr = pernr,
        list_viewer->set_visible exporting visible = 'X',
        html_viewer->set_visible exporting visible = ' '.
    *ENDIF.
    *    CALL METHOD cl_gui_cfw=>flush.
      endmethod.                    "handle_node_double_click
    *METHOD fill_html.
    *DATA url TYPE scarr-url.
    *SELECT SINGLE url
    *FROM scarr
    *INTO url
    *WHERE infty = infty.
    *CALL METHOD html_viewer->show_url EXPORTING url = url.
    *ENDMETHOD.
      method fill_list.
        data: flight_tab type table of demofli,
        begin of flight_title,
        carrname type scarr-carrname,
        cityfrom type spfli-cityfrom,
        cityto type spfli-cityto,
        end of flight_title,
        list_layout type lvc_s_layo.
    *DATA : it_pa0001 TYPE TABLE OF p0001.
        if infty = '0001'.
          select * from pa0001 into table it_pa0001 where pernr = pernr.
        elseif infty = '0000'.
          select * from pa0001 into table it_pa0001 where pernr = pernr.
        endif.
    *SELECT SINGLE c~carrname p~cityfrom p~cityto
    *INTO CORRESPONDING FIELDS OF flight_title
    *FROM ( scarr AS c
    *INNER JOIN spfli AS p ON c~carrid = p~carrid )
    *WHERE p~carrid = carrid AND
    *p~connid = connid.
    *SELECT fldate seatsmax seatsocc
    *INTO CORRESPONDING FIELDS OF TABLE flight_tab
    *FROM sflight
    *WHERE carrid = carrid AND connid = connid
    *  ORDER BY fldate.
    *CONCATENATE flight_title-carrname
    *connid
    *flight_title-cityfrom
    *flight_title-cityto
        list_layout-grid_title = 'TEST'.
        list_layout-smalltitle = 'X'.
        list_layout-cwidth_opt = 'X'.
        list_layout-no_toolbar = 'X'.
    *if infty = '0001'.
        call method list_viewer->set_table_for_first_display
          exporting
            i_structure_name = 'PA0001'
            is_layout        = list_layout
          changing
            it_outtab        = it_pa0001.
    * CALL METHOD cl_gui_cfw=>flush.
    *ELSEIF infty = '0001'.
    *CALL METHOD list_viewer->set_table_for_first_display
    *EXPORTING i_structure_name = 'PA0000'
    *is_layout = list_layout
    *CHANGING it_outtab = it_pa0000.
    *endif.
      endmethod.                    "fill_list
    endclass.                    "screen_handler IMPLEMENTATION
    start-of-selection.
      data : it_pa0001 type table of p0001.
      call screen 100.
    *  MODULE status_0100 OUTPUT
    module status_0100 output.
      set pf-status 'SCREEN_100'.
      set titlebar 'TIT_100'.
      call method screen_init=>init_screen.
    *   CALL METHOD cl_gui_cfw=>flush.
    endmodule.                    "status_0100 OUTPUT
    *  MODULE cancel INPUT
    module cancel input.
      set screen 0.
      leave program.
    endmodule.                    "cancel INPUT
    Plz Suggest ,
    Regards ,
    Paresh G.

    METHOD fill_tree.
        DATA: node_table TYPE TABLE OF abdemonode,
        node TYPE abdemonode.
    *data : it_pa0001 TYPE TABLE OF p0001,
        DATA :wa_pa0001 TYPE pa0001,
              wa_pa0000 TYPE pa0000,
              it_t582s TYPE TABLE OF t582s,
              wa_t582s TYPE t582s.
        TYPES : BEGIN OF ttab,
                 itext TYPE t582s-itext,
                 infty TYPE t582s-infty,
                 pernr TYPE p0001-pernr,
                 END OF ttab.
        DATA : itab TYPE TABLE OF ttab,
               wa_tab TYPE ttab.
          FIELD-SYMBOLS : <fs> LIKE p_pernr.
          DATA : text1 TYPE c.
        node-hidden = ' '.
        node-disabled = ' '.
        node-isfolder = 'X'.
        node-expander = ' '.
        SELECT * FROM t582s
                 INTO CORRESPONDING FIELDS OF TABLE it_t582s
                 WHERE sprsl = sy-langu
                   AND infty IN ('0001','0000')."'0002','0006',
                            '0008','0015','0019').
        LOOP AT it_t582s INTO wa_t582s .
          MOVE-CORRESPONDING wa_t582s TO wa_tab.
          node-node_key = wa_t582s-infty.
          CLEAR node-relatkey.
          CLEAR node-relatship.
          node-text = wa_t582s-itext.
          node-n_image = ' '.
          node-exp_image = ' '.
          APPEND node TO node_table.
          LOOP AT p_pernr ASSIGNING <fs>.
            wa_tab-pernr = <fs>-low.
            APPEND wa_tab TO itab.
            CLEAR p_pernr-low.
            node-node_key = <fs>-low.
            node-relatkey = wa_tab-infty.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
            node-text = <fs>-low.
            node-n_image = '@AV@'.
            APPEND node TO node_table.
          ENDLOOP.
    CLEAR : wa_tab,wa_pa0001,wa_pa0000.
        ENDLOOP.
    CALL METHOD tree->add_nodes
          EXPORTING
            table_structure_name = 'ABDEMONODE'
            node_table           = node_table.
       CALL METHOD cl_gui_cfw=>flush.
      ENDMETHOD.                    "fill_tree

  • Client not picking correct AP

    Hello,
    Just wondering if anyone has any ideas on why a client would not select the "better" AP?  This particular client see's 4 AP's and one of them is obviously the better one at -64.  Yet it inists that it wants to connect to one of the worst ones at -84.  There is no logic in it, and I don't see a way to force to to connect to the closer AP.
    Thanks,
    Dan.

    Dan,
    Most times the controller will instruct an AP to reduce power if it detects co-channel interference i.e another AP transmitting on the same channel. I am not really a great advocate of auto power settings because most times APs are at full blast until there is co-channel interference. Max power encourages hidden node problem.
    Regarding what rates, it's hard to say because clients may support different data rates at the same RSSI level. For 802.11g, mandatory rates are 6,12, and 24. Hence you could disable 6 and 9 or change to supported and set your mandatory to 12 or disable 6,9, 12 and set mandatory to 24.
    What is the distance of the problem client in relation to both APs? Have you taken the client closer to the AP behind the cinder wall and see if it still stays on the other AP.

  • Building Tree hierarchy Using nested loops and class cl_gui_column_tree

    Hello gurus,
    I want to create a tree report using custom container and class cl_gui_column_tree. I have read and understood the standard demo report which SAP has provided i.e. SAPCOLUMN_TREE_CONTROL_DEMO. But in this report all the levels nodes are created as constants and hardcoded. I want to create hierarchy using nested loops. For this i took one example of a hierarchy of VBAK-VBELN->VBAP-POSNR Like One sales order has many line items and each line item can have number of line items in billing plan.
    I have done some coding for it.
    FORM build_tree USING node_table TYPE treev_ntab
                                           item_table TYPE zitem_table.              " i created the zitem_table table type of mtreeitm in SE11.
      DATA: node TYPE treev_node,
                 item TYPE mtreeitm.
      node-node_key = root.
      CLEAR node-relatkey.
      CLEAR node-relatship.
      node-hidden = ' '.
      node-disabled = ' '.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      node-isfolder = 'X'.
      node-expander = 'X'.
      APPEND node TO node_table.
      item-node_key = root.
      item-item_name = colm1.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Root'.
      APPEND item TO item_table.
      item-node_key = root.
      item-item_name = colm2.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Amount'.
      APPEND item TO item_table.
      LOOP AT it_vbeln INTO wa_vbeln.
        node-node_key = wa_vbeln-vbeln.
        node-relatkey = root.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = 'X'.
        node-expander = 'X'.
        APPEND node TO node_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-vbeln.
        APPEND item TO item_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-netwr.
        APPEND item TO item_table.
        LOOP AT it_posnr INTO wa_posnr.
        node-node_key = wa_posnr-posnr.
        node-relatkey = wa_vbeln-vbeln.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = ' '.
        node-expander = ' '.
        APPEND node TO node_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-posnr.
        APPEND item TO item_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-netpr.
        APPEND item TO item_table.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
    Now this program compiles fine and runs till there is only one level. That is root->vbeln. But when i add one more loop of it_posnr it gives me runtime error of message type 'X'. The problem i found was uniqueness of item-item_name as all the sales order have posnr = 0010. What could be done? I tried giving item_name unique hierarchy level using counters just like stufe field in prps eg. 10.10.10, 10.10.20,10.20.10,10.20.20,20.10.10 etc.. etc.. but still i am getting runtime error when i add one more hierarchy using nested loop. Plz guide.
    Edited by: Yayati6260 on Jul 14, 2011 7:25 AM

    Hello all,
    Thanks the issue is solved. The node key was not getting a unique identification as nodekey. I resolved the issue by generating unique identification for each level. Thanks all,
    Regards
    Yayati Ekbote

  • How to disable automatic loading of iView/Page in detailed navigation?

    Hello,
    We've upgraded our portal 7.0 from SP9 to SP12.
    I've noticed that SAP have added this change: Whenever a user is navigating between one role/tab to another in the top level navigation the first folder at the detailed navigation is automatically opened and the first content there is automatically loaded.
    I would like to disable this option - I've looked at the new properties that have been added to the detailed navigation iView between SP9 and SP12 and could only find these two: Display Parent of Hidden Node and Open Folder When Launched.
    These two are not solving this problem and they are disabled anyway.
    Any ideas...?
    Roy

    Roy,
    Role and Workset Hierarchy:
    Folders F1 and F2 (Roles) are defined as entry points and therefore appear on the first level of the top level navigation bar. What happen is when we click F1 (Role), the underlying folders F1a and F1b (Worksets) appear on the second level. On click on F1a the first entry F1a (Workset) of the second level is activated and its contents (iViews) are displayed in the detail navigation and the contents of the iView is displayed in the portal page of the content area.
    And same procedure happens with F2 role on the first level of the top level navigation bar. When we click on the F2 (Role) the underlying folders F2a and F2b (Worksets) appear on the second level of the top level navigation bar. On click on F2a the first entry F2a (Workset) of the second level is activated and its contents (iViews) are displayed in the detail navigation and the contents of the iView is displayed in the portal page of the content area.
    I think need to configure levels of TLN which includes top level navigation, detail navigation and content area and then need to define the entry points.
    Below are the links for configuring levels of TLN and right below it you will find link for define entry point:
    http://help.sap.com/saphelp_nw04/helpdata/en/5a/33befa45ca7f459b24d0c5d51d0749/frameset.htm
    Hope this time it helps you.
    Thanks
    Mona

  • Hierarchical tree item - how to improve performance

    I'm loading hierarchical tree item with query.
    Problem is that it takes very long to load all the items(300, but can be more) to the hierarchical item.
    Query takes 0.5 sec., but loading it into the item with Set_Tree_Property(htree, Ftree.RECORD_GROUP
    the code:
    PL1 := Create_Group_From_Query('pl1', query);
    v_ignore := Populate_Group(PL1); -- 0.5 sec
    Ftree.Set_Tree_Property(htree, Ftree.RECORD_GROUP, PL1); -- 3 sec.
    Does anyone have any idea what to do to improve tree loading?

    Hello,
    try to play a little bit with the state-column of your query. If you only display the first hierarchy level
    and set the state of the "hidden" nodes to open, I think ist is the state 1, then it works much faster.
    cu
    Matthias M|ller

  • Handle stack navigation in control framework application development.

    Hello,
      Let me know if anyone has implemented in any application using OO controls as ALV-GRID, TREE, HTML, TextEdit, etc., using a stack of navigation similar to transaction SE80.
    If anyone could implement an stack navigation, please share its experience in this forum.
    Thanks.
    Edited by: Roberto Rodríguez on Jun 20, 2008 9:49 PM
    Edited by: Roberto Rodríguez on Jun 20, 2008 9:50 PM

    Roberto,
    Not sure if this will help you, but I use SAPCOLUMN_TREE_CONTROL_DEMO to create a menu, but it easily could have been changed to display like SE80. 
    I nearly totaly rewrote there include module COLUMN_TREE_CONTROL_DEMOF01 for it and did as follows.   You could easily get the info to fill the tree from tables to do as you prefer.
    ***INCLUDE column_tree_control_demoF01 .
    *&      Form  CREATE_AND_INIT_TREE
    FORM create_and_init_tree.
    *  DATA: NODE_TABLE TYPE TREEV_NTAB,
    *        ITEM_TABLE TYPE ITEM_TABLE_TYPE,
      DATA: event TYPE cntl_simple_event,
            events TYPE cntl_simple_events,
            hierarchy_header TYPE treev_hhdr.
    * create a container for the tree control
      CREATE OBJECT g_custom_container
        EXPORTING
          " the container is linked to the custom control with the
          " name 'TREE_CONTAINER' on the dynpro
          container_name = 'TREE_CONTAINER'
        EXCEPTIONS
          cntl_error = 1
          cntl_system_error = 2
          create_error = 3
          lifetime_error = 4
          lifetime_dynpro_dynpro_link = 5.
      IF sy-subrc <> 0.
        MESSAGE a000.
      ENDIF.
    * setup the hierarchy header
      hierarchy_header-heading = 'System'.                      "#EC NOTEXT
      " heading
      hierarchy_header-width = 40.         " width: 30 characters
    * create a tree control
    * After construction, the control contains one column in the
    * hierarchy area. The name of this column
    * is defined via the constructor parameter HIERACHY_COLUMN_NAME.
      CREATE OBJECT g_tree
        EXPORTING
          parent              = g_custom_container
          node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
          item_selection = 'X'
          hierarchy_column_name = 'Column1'
          hierarchy_header = hierarchy_header
        EXCEPTIONS
          cntl_system_error           = 1
          create_error                = 2
          failed                      = 3
          illegal_node_selection_mode = 4
          illegal_column_name         = 5
          lifetime_error              = 6.
      IF sy-subrc <> 0.
        MESSAGE a000.
      ENDIF.
    * define the events which will be passed to the backend
      " node double click
      event-eventid = cl_gui_column_tree=>eventid_node_double_click.
      event-appl_event = 'X'. " process PAI if event occurs
      APPEND event TO events.
      " item double click
      event-eventid = cl_gui_column_tree=>eventid_item_double_click.
      event-appl_event = 'X'.
      APPEND event TO events.
      " expand no children
      event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      event-appl_event = 'X'.
      APPEND event TO events.
      " link click
      event-eventid = cl_gui_column_tree=>eventid_link_click.
      event-appl_event = 'X'.
      APPEND event TO events.
      " button click
      event-eventid = cl_gui_column_tree=>eventid_button_click.
      event-appl_event = 'X'.
      APPEND event TO events.
      " checkbox change
      event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
      event-appl_event = 'X'.
      APPEND event TO events.
      " header click
      event-eventid = cl_gui_column_tree=>eventid_header_click.
      event-appl_event = 'X'.
      APPEND event TO events.
      CALL METHOD g_tree->set_registered_events
        EXPORTING
          events = events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE a000.
      ENDIF.
    * assign event handlers in the application class to each desired event
      SET HANDLER g_application->handle_node_double_click FOR g_tree.
      SET HANDLER g_application->handle_item_double_click FOR g_tree.
      SET HANDLER g_application->handle_expand_no_children FOR g_tree.
    *  SET HANDLER G_APPLICATION->HANDLE_LINK_CLICK FOR G_TREE.
    *  SET HANDLER G_APPLICATION->HANDLE_BUTTON_CLICK FOR G_TREE.
    *  SET HANDLER G_APPLICATION->HANDLE_CHECKBOX_CHANGE FOR G_TREE.
      SET HANDLER g_application->handle_header_click FOR g_tree.
    * insert two additional columns
      perform add_a_column using 'Column2'      "col_name.
                                 '50'           "col_width
                                 'Description'. "col_text
      perform add_a_column using 'Column3'      "col_name.
                                 '21'           "col_width.
                                 'Tran Code'.   "col_text
    * add some nodes to the tree control
    * NOTE: the tree control does not store data at the backend. If an
    * application wants to access tree data later, it must store the
    * tree data itself.
      PERFORM build_node_and_item_table USING node_table item_table.
      CALL METHOD g_tree->add_nodes_and_items
        EXPORTING
          node_table = node_table
          item_table = item_table
          item_table_structure_name = 'MTREEITM'
        EXCEPTIONS
          failed = 1
          cntl_system_error = 3
          error_in_tables = 4
          dp_error = 5
          table_structure_name_not_found = 6.
      IF sy-subrc <> 0.
        MESSAGE a000.
      ENDIF.
      PERFORM expand_the_root USING 'Root'.
      PERFORM expand_the_root USING 'Root2'.
    *  PERFORM expand_the_root USING 'Root3'.
    *  PERFORM expand_the_root USING 'Root4'.
    *  PERFORM expand_the_root USING 'Root5'.
    ENDFORM.                    " CREATE_AND_INIT_TREE
    *&      Form  build_node_and_item_table
    FORM build_node_and_item_table
      USING
        node_table TYPE treev_ntab
        item_table TYPE item_table_type.
    * Root 1
      PERFORM add_root USING node_table 'Root'.
      PERFORM add_item_info USING item_table
                                  'Root'                        "node_key
                                  'Column1'                     "col1_name
                                  'Account'                     "col1_text
                                  'Column2'                     "col2_name
                                  ' '                           "col2_text
                                  'Column3'                     "col3_name
                                  ' '.                          "col3_text.
      PERFORM add_child USING node_table 'Root' 'Child1'.
      PERFORM add_item_info USING item_table
                                  'Child1'                      "node_key
                                  'Column1'                     "col1_name
                                  'Add Lead'                    "col1_text
                                  'Column2'                     "col2_name
                                  'Add New Lead'                "col2_text
                                  'Column3'                     "col3_name
                                  'ZLM01'.                      "col3_text.
      PERFORM add_child USING node_table 'Root' 'Child2'.
      PERFORM add_item_info USING item_table
                                  'Child2'                      "node_key
                                  'Column1'                     "col1_name
                                  'Modify Lead'                 "col1_text
                                  'Column2'                     "col2_name
                                  'Modify Existing Lead'        "col2_text
                                  'Column3'                     "col3_name
                                  'ZLM02'.                      "col3_text.
      PERFORM add_child USING node_table 'Root' 'Child3'.
      PERFORM add_item_info USING item_table
                                  'Child3'                      "node_key
                                  'Column1'                     "col1_name
                                  'Display Lead'                "col1_text
                                  'Column2'                     "col2_name
                                  'Display Existing Lead'       "col2_text
                                  'Column3'                     "col3_name
                                  'ZLM03'.                      "col3_text.
      PERFORM add_child USING node_table 'Root' 'Child4'.
      PERFORM add_item_info USING item_table
                                  'Child4'                      "node_key
                                  'Column1'                     "col1_name
                                  'Search Help'                 "col1_text
                                  'Column2'                     "col2_name
                                  'Search Help'                 "col2_text
                                  'Column3'                     "col3_name
                                  'ZLMR5'.                      "col3_text.
    * Root 2
      PERFORM add_root USING node_table 'Root2'.
      PERFORM add_item_info USING item_table
                                  'Root2'                       "node_key
                                  'Column1'                     "col1_name
                                  'Reports'                     "col1_text
                                  'Column2'                     "col2_name
                                  ' '                           "col2_text
                                  'Column3'                     "col3_name
                                  ' '.                          "col3_text.
      PERFORM add_child USING node_table 'Root2' 'Child21'.
      PERFORM add_item_info USING item_table
                                  'Child21'                     "node_key
                                  'Column1'                     "col1_name
                                  'Lead Detail'                 "col1_text
                                  'Column2'                     "col2_name
                                  'Selection List'              "col2_text
                                  'Column3'                     "col3_name
                                  'ZLMR4'.                      "col3_text.
      PERFORM add_child USING node_table 'Root2' 'Child22'.
      PERFORM add_item_info USING item_table
                                  'Child22'                     "node_key
                                  'Column1'                     "col1_name
                                  'Unassigned Leads'            "col1_text
                                  'Column2'                     "col2_name
                                  'Unassigned Leads'            "col2_text
                                  'Column3'                     "col3_name
                                  'ZLMR2'.                      "col3_text.
      PERFORM add_child USING node_table 'Root2' 'Child23'.
      PERFORM add_item_info USING item_table
                                  'Child23'                     "node_key
                                  'Column1'                     "col1_name
                                  'Follow Up Required'          "col1_text
                                  'Column2'                     "col2_name
                                  'Follow Up Required'          "col2_text
                                  'Column3'                     "col3_name
                                  'ZLMR3'.                      "col3_text.
      PERFORM add_child USING node_table 'Root2' 'Child24'.
      PERFORM add_item_info USING item_table
                                  'Child24'                     "node_key
                                  'Column1'                     "col1_name
                                  'Birthday Report'             "col1_text
                                  'Column2'                     "col2_name
                                  'Select Contacts by Birthdate' "col2_text
                                  'Column3'                     "col3_name
                                  'ZLMR6'.                      "col3_text.
      PERFORM add_child USING node_table 'Root2' 'Child25'.
      PERFORM add_item_info USING item_table
                                  'Child25'                     "node_key
                                  'Column1'                     "col1_name
                                  'Mailing Labels'              "col1_text
                                  'Column2'                     "col2_name
                                  'Mailing Labels'              "col2_text
                                  'Column3'                     "col3_name
                                  'ZLMR8'.                      "col3_text.
      PERFORM add_child USING node_table 'Root2' 'Child26'.
      PERFORM add_item_info USING item_table
                                  'Child26'                     "node_key
                                  'Column1'                     "col1_name
                                  'Pipeline'                    "col1_text
                                  'Column2'                     "col2_name
                                  'Pipeline'                    "col2_text
                                  'Column3'                     "col3_name
                                  'ZLMR9'.                      "col3_text.
    ** Root 3
    *  PERFORM add_root USING node_table 'Root3'.
    *  PERFORM add_item_info USING item_table
    *                              'Root3'                       "node_key
    *                              'Column1'                     "col1_name
    *                              'Utilities'                   "col1_text
    *                              'Column2'                     "col2_name
    *                              ' '                           "col2_text
    *                              'Column3'                     "col3_name
    *                              ' '.                          "col3_text.
    *  PERFORM add_child USING node_table 'Root3' 'Child31'.
    *  PERFORM add_item_info USING item_table
    *                              'Child31'                     "node_key
    *                              'Column1'                     "col1_name
    *                              'Maintain'                    "col1_text
    *                              'Column2'                     "col2_name
    *                              'Homes File'                  "col2_text
    *                              'Column3'                     "col3_name
    *                              'ZLMX3'.                      "col3_text.
    ENDFORM.                    " build_node_and_item_table
    *&      Form  add_root
    FORM add_root   USING
        node_table TYPE treev_ntab
        root_name.
      node-node_key = root_name.
      " Key of the node
      CLEAR node-relatkey.      " Special case: A root node has no parent
      CLEAR node-relatship.     " node.
      node-hidden = ' '.        " The node is visible,
      node-disabled = ' '.      " selectable,
      node-isfolder = 'X'.      " a folder.
      CLEAR node-n_image.       " Folder-/ Leaf-Symbol in state "closed":
      " use default.
      CLEAR node-exp_image.     " Folder-/ Leaf-Symbol in state "open":
      " use default
      CLEAR node-expander.      " see below.
      APPEND node TO node_table.
    ENDFORM.                    " add_root
    *&      Form  add_child
    FORM add_child USING
        node_table TYPE treev_ntab
        root_name
        child_name.
      node-node_key = child_name.
      " Key of the node
      " Node is inserted as child of the node with key 'Root'.
      node-relatkey = root_name.
      node-relatship = cl_gui_column_tree=>relat_last_child.
      node-hidden = ' '.
      node-disabled = ' '.
      node-isfolder = ' '.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      node-expander = ' '. " The node is marked with a '+', although
      " it has no children. When the user clicks on the
      " + to open the node, the event expand_nc is
      " fired. The programmerr can
      " add the children of the
      " node within the event handler of the expand_nc
      " event  (see callback handle_expand_nc).
      APPEND node TO node_table.
    ENDFORM.                    " add_child
    *&      Form  expand_the_root
    FORM expand_the_root USING    root_name.
    * expand the node with key 'Root'
      CALL METHOD g_tree->expand_node
        EXPORTING
          node_key = root_name
        EXCEPTIONS
          failed              = 1
          illegal_level_count = 2
          cntl_system_error   = 3
          node_not_found      = 4
          cannot_expand_leaf  = 5.
      IF sy-subrc <> 0.
        MESSAGE a000.
      ENDIF.
    ENDFORM.                    " expand_the_root
    *&      Form  add_item_info
    *       text
    *      -->P_ITEM_TABLE  text
    *      -->P_ROOT_NAME  text
    *      -->P_COL1_NAME  text
    *      -->P_COL1_TEXT  text
    *      -->P_COL2_NAME  text
    *      -->P_COL2_TEXT  text
    *      -->P_COL3_NAME  text
    *      -->P_COL3_TEXT  text
    FORM add_item_info USING item_table TYPE item_table_type
                             node_key
                             col1_name
                             col1_text
                             col2_name
                             col2_text
                             col3_name
                             col3_text.
      CLEAR item.
      item-node_key = node_key.
      item-item_name = col1_name.     " Item of Column 'Column1'
      item-class = cl_gui_column_tree=>item_class_text. " Text Item
      item-text = col1_text.
      APPEND item TO item_table.
      CLEAR item.
      item-node_key = node_key.
      item-item_name = col2_name.     " Item of Column 'Column2'
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = col2_text.
      APPEND item TO item_table.
      CLEAR item.
      item-node_key = node_key.
      item-item_name = col3_name.     " Item of Column 'Column3'
      " Item is a link (click on link fires event LINK_CLICK)
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = col3_text.             "
      APPEND item TO item_table.
    ENDFORM.                    " add_item_info
    *&      Form  add_a_column
    form add_a_column using    col_name
                               col_width
                               col_text.
      CALL METHOD g_tree->add_column
        EXPORTING
          name = col_name
          width = col_width
          header_text = col_text
        EXCEPTIONS
          column_exists                 = 1
          illegal_column_name           = 2
          too_many_columns              = 3
          illegal_alignment             = 4
          different_column_types        = 5
          cntl_system_error             = 6
          failed                        = 7
          predecessor_column_not_found  = 8.
      IF sy-subrc <> 0.
        MESSAGE a000.
      ENDIF.
    endform.                    " add_a_column

  • CSMA/CA NAV/Duration field and random backoff timer - Process

    Hi guys,
    Gotta a quick one for you.
    Pls see text below
    As a condition to accessing the medium, the MAC Layer checks the value of its network allocation vector (NAV), which is a counter resident at each station that represents the amount of time that the previous frame needs to send its frame. The NAV must be zero before a station can attempt to send a frame. Prior to transmitting a frame, a station calculates the amount of time necessary to send the frame based on the frame's length and data rate. The station places a value representing this time in the duration field in the header of the frame. When stations receive the frame, they examine this duration field value and use it as the basis for setting their corresponding NAVs. This process reserves the medium for the sending station.
    An important aspect of the DCF is a random back off timer that a station uses if it detects a busy medium. If the channel is in use, the station must wait a random period of time before attempting to access the medium again. This ensures that multiple stations wanting to send data don't transmit at the same time. The random delay causes stations to wait different periods of time and avoids all of them sensing the medium at exactly the same time, finding the channel idle, transmitting, and colliding with each other. The back off timer significantly reduces the number of collisions and corresponding retransmissions, especially when the number of active users increases.
    So, if all clients in a WLAN see a frame come from station A, and station A has set the duration field, all other stations set their NAV and wait until it expires.
    THEN, i would expect all stations to start to contend for the medium at exactly the same time.
    BUT you have the random backoff timer.
    The question is does the NIC add a random number to the NAV field, ie, once it sees station As duration field value (lets say 300us) it adds 47us to this and the NAV is 347us? -- or do all stations decrement the NAV field to zero and then start a random backoff timer?
    Many thx for the help,
    Kind regards,
    Ken

    Sorry chaps, but I think you've got this wrong...
    The whole point of a NAV being transmitted by the TX & RX ends is to stop hidden node issues - with both ends transmitting the NAV, you are guaranteeing that every 802.11 device within range of either end of the transaction is quiet for the duration of the NAV.
    Lets say we have a TX (A) and an RX (B), and another device (C). Lets say that (A) can hear (B), and that (B) can hear (A) and (C). (A) and (C) cannot hear each other.
    (A) <<>> (B) <<>> (C)
    Applying that to your scenario...
    <>
    it now counts down to 310, it checks the air, and sees the same packet still being transmitted
    309, 308, 307 .............
    gets down to 12us, checks the ait, NOW DOES NOT see a packet being transmitted.
    you count down to 11, it check the air, you donot see a packet being transmitted.
    <>
    The part where it jumps down from 312 to 11 is wrong. Just because (C) can't hear anything, doesn't mean that (B) isn't receiving something from (A).
    What actually happens with NAV's is;
    [Lets say (A) is transmitting to (B)]
    1. (A) transmits NAV, value = "NAV-A"
    2. (B) receives packet, along with everything else in range of (A), on the same channel as (A)
    3. (B) responds to (A) with "NAV-B". "NAV B" = "NAV-A" [minus] "Elapsed Time"
    4. (A) receives packet, along with everything in range of (B), on the same channel as (B)
    At this point, every device on that channel will be silent for the duration of the NAV, regardless of whather or not they hear anything during the NAV countdown duration.
    When the NAV expires, the Random Backoff Timer begins, and the lowest/ quickest client to get to zero then gets to transmit, and the whole process starts again.
    Let me know what you think, but I'm pretty sure that's how it actually works.
    Rgds,
    Richard

  • Collapsed Tabular Form Heading when "No data found".

    The ' Collapsed Tabular Form Heading when "No data found" ' problem (speculated to be bug 9893564) is discussed here: {message:id=4419231}. Warning link is out of date. I'm still seeing it in APEX 4.2.
    I support Kelly's comments "looks like something is broken" and "Now this header (which is sized smaller before data is retrieved) comes between the search items and the help message and looks clumsy.".{message:id=9185914}.
    Any suggestion to get around it when no data is found?
    1) Is there a way to hide the header when there is no data? Or,
    2) Is there a way to adjust the width of the columns if the header must display? I'd like them to be about what they are when data is displayed. I know those lengths but not how to affect the header width for a tabular report with no data.
    Example:
    WS APEX_EXAMPLES_01
    demo
    demo
    Appl 78329 Tabular Form - page 1. (I forced query not to find any data for demo purposes.)
    Thanks,
    Howard

    Howard (... in Training) wrote:
    Paul --
    Great! So many new techniques here -- new to me. Generally, I much prefer positive logic as well. But this solution seems to have more pieces than the other.There is method in that.
    Firstly, with Aljaz's approach you can see a flicker as the tabular form is actually rendered and then hidden when the script in the footer is eventually run. This will be more apparent with a longer or more complicated page where it takes longer to reach the script and more content needs to be adjusted following removal of the form. Reversing the logic and hiding the form using CSS in the page header prevents this as the form elements are initially created as hidden nodes in the DOM before any of the page is rendered.
    More important is that this approach applies the principles of the separation of concerns and unobtrusive JavaScript. At some point when developing in APEX you're going to find yourself seriously losing your cool in a situation where you know the app is executing some JavaScript, but you can't find where that script is defined (maybe you've already been there). Look at the page 2 definition using the tree view: where's the JavaScript that is going to run? Now look at page 1: ah, there are a couple of dynamic actions...
    APEX now includes a lot of containers specifically for JavaScript: File URLs, Function and Global Variable Declaration and Execute when Page Loads in page templates and page headers, and declarative and custom Execute JS Code Dynamic Actions. These provide for good separation of concerns: we should use these locations for JS code, and avoid the exasperation of hunting through templates, page/region headers/footers, page 0 regions, pre-/post-element text or wherever to find the script we can see in the page source or JS debugger.
    Aljaz's solution also depends on detecting the presence of the No Data Found message with class <tt>nodatafound</tt>, and on modifying the Add Row button.
    What if someone changes the class of the No Data Found message in the report attributes? The Exists... condition on the dynamic action performs this check in a more direct way (although it's not ideal: DRY is violated by having both 2 copies and 2 executions of the report SQL; nor is it reusable on other form regions).
    Modifying the Add Row button JavaScript directly is intrusive. Like footers and templates, it's another non-obvious location for JS customisation. By using a dynamic action to bind another click handler to the button we're making the modification more obvious, and more importantly we don't have to modify what it's already doing&mdash;or in this instance, even care what that is (in other circumstances we might need to change the order or propagation of events, or suppress the original behaviour).
    As for reusability, my original solution didn't really consider this (as it wasn't mentioned in the OP). Since the subject has been raised, and in accordance with my comments above, I'd approach it in a different way.
    As discussed, I suggest not squirrelling JavaScript away in region templates. I'd create a reusable report template for tabular forms rather than a region one. A <tt>class</tt> defined on the report container there will provide a more direct selector for hide/show behaviour. I'd stick to initially hiding this report via CSS, and use dynamic actions defined on the global page to conditionally show it on page load and bind show behaviour to the Add Row button click. To make these DAs reusable I'd remove the Exists... condition from the first one and replace it with a JS condition that checks to see if the tabular form report contains any visible data rows (the class on the report template will help there as well). Binding the show behaviour to the Add Row button would use the <tt>onclick</tt> attribute as a selector (rather than an ID selector that requires an intrusive edit of the button) so that all Add Row buttons would be affected: <tt>$('button[onclick^="apex.widget.tabular.addRow"]')</tt>.
    And about the style code:
    #report_tabular-form,
    #report_tabular-form .report-standard {
    min-width: 90%;
    } That is an improvement. I had read about it but not considered it for this. I tried the technique used to adjust column width on other reports but when I use "div," it makes the data in that column display only. I really want to adjust the width of the individual column header. Is there a way to do that?I'm not really clear what you're asking here. (Use "div"? Where? How?)
    To control the width of individual report column headers, use the following CSS:
    th#COLUMN_ALIAS {
      width: 10em;
    }Where <tt>COLUMN_ALIAS</tt> is the alias of the column in the query: APEX uses this as the HTML <tt>id</tt> attribute for the column table header element. (Note that <tt>id</tt> attributes must be unique within a document, so it the same column appears in multiple reports/forms, ensure each column alias is unique.)

  • About Records Management (TCODE ORGANIZER)

    Hi to all,
    First tell me if this thread is at incorrect place.
    My question is:
    When I open a record in Organizer with a different folders and I open a folder system said me:
    Node hidden: 0 (visibility check), 1 (authorization check)                                                                               
    Message no. SRM_BR047                                                                               
    Diagnosis                                                                               
    At least one node is not displayed because of insufficient             
        authorization. Two authorization checks are performed:                                                                               
    o   Visibility check: In the Records Modeler and the Records Browser,  
            you can determine which nodes are to be visible for which users. The
            system checks the authorization for displaying nodes on the basis of
            these entries.                                                                               
    o   Authorization check: The system checks the authorization for       
            displaying nodes using the authorization objects, which are entered
            in the user role.                                                  
    I need this hidden node. And I'm using SAP_ALL user. I don't know why system hidden my node.                                                                           
    I cannot create a new one too.
    A lot of thanks in advance.
    Best regards

    hi,
    The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. They usually occur in authorization objects together with an activity.
    The table that contains all authorization objects is TOBJ.
    The table that contains all activities is TACT.
    The table that contains definition of all authorization groups is TBRG.
    TBRG -- Contains all authorization groups and gives information about relation between authorization object and authorization group. The description of the authorization groups is defined in table TBRGT.
    Regards,
    Prabhudas

Maybe you are looking for