Community articlegetChildren method
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars


This method, along with getParent, is used to traverse vertically along the form hierarchy. getChildren returns the first child of the indicated node. If the node has no children, null is returned. All child nodes of a FormNodeP can be traversed using a while loop in combination with getNext.


   public FormNodeP getChildren( ) throws UWIException;   


There are no parameters for this method.


The FormNodeP that represents the child or null if no child exists. It will throw a generic exception (UWIException) if an error occurs.


In the following example the root node of a form is represented by a FormNodeP called theForm. The method dereferenceEx is used to retrieve an item from the form called PAGE1.NAMELABEL.
   public class getFunctions
   private static FormNodeP theForm;
   private static FormNodeP childNode;
      /* Additional Code Removed */
      public static void main(String argv[])
      FormNodeP tempNode;
         /* Additional Code Removed */
         if ((tempNode = theForm.dereferenceEx(null, "PAGE1.NAMELABEL", 
            0,FormNodeP.UFL_ITEM_REFERENCE, null)) == null)
            throw new UWIException("Could not locate Name label node.");
         childNode = tempNode.getChildren( );
         childNode.setLiteralEx(null, "The value option is the first "); 
         /* Additional Code Removed */

Parent topic:
FormNodeP class