UI Element Tree

Hi,
I am using a Tree UI Element
Customer(Tree Node type)
- Order (Tree Node type)
  Item (Tree Item type)
- Purchase Order (Tree Node type)
  Purchase Item (Tree Item type)
I have this in a Viewset on the left side of the screen. When I click on Item (Tree Item type) value I trigger an Action to Call a view on the left side of the viewset.
I get the following error:
<b>you can access the singleton child node 'Item' only via lead selection</b>
I am new to Webdynpro, and am not aware whether I can trigger an action to call another view in a viewset.
Please advice as to what I may be doing wrong.
Thank you.
NAC

Hi,
   Are you putting your value attribute in a value node.
If so you can bind them to ur UI element and select the  value attribute variable through the lead selection.Make the singleton property false in ur context node.
Jus chk it.
You can call a view from the action in the viwset coz viewset is nothing but a collection of view which internally has UI element.You have to use inbound and outbound plug for the same.
Hope it helps.
Rdgs,
Guru

Similar Messages

  • Library to be used to create an element tree

    Hi all,
    My use case is to link all elements together, so that I can form an element tree,
    Here's the example:
                             Element A
                                    |
               ____________|____________
               |                                          |
         Element B                         Element C
                                                          |
                                     ____________|____________
                                     |                                          |
                           Element D                               Element EMy problem is, I can't find a suitable class/library to link all elements. I have tried to use <vector>, <arraylist>, but seems that it is not the correct library.
    Please assist me. Thank you.

    It's the only thing I can think of. It's designed to be the data model of a JTree, but it's a node-based data model alright. Everything in the Collections package is rather aimed at "peer items" and not so much at hierarchic structures.

  • Creatin UI element TREE and on CLick display View onto Right

    Hi Experts,
    I want to create tree on the left hand side of view and on clicking either parent or child, I want to display details in corresponding view in the right hand side.
    Could you please provide me the approach for this?
    Thanks
    Depesh

    Hi Deepesh,
    I guess that you would be better off using an [NavigationList |http://help.sap.com/saphelp_nw70/helpdata/EN/98/9faf4241d4b911e10000000a1550b0/content.htm]UI element for this particular scenario.
    The NavigationList allows to display hierarchical organized content by means of a tree-like structure. However, the only difference is that this element does not allow to define nodes that can be expanded and collapsed like a Tree does. Also whenever you select an selectable list item the system triggers an event by name "Select". You can write your coding within the event handler of this method. This UI element is 1 of the elements being covered in the [NET312 course|http://www.sap.com/services/education/catalog/course.epx?context=[[|NET312|||062|G]]|].
    Regards,
    Uday

  • How to use the action OnExpandAll on UI element Tree

    Hi, experts .
    I am in WDA developing project and developing the screen which has Tree .
    I want to expand all nodes when users click the button on the head of Tree .
    I copied the application `WDT_TREE` and created Tree of my application successfully .
    And I created the action OnExpandAll on my Tree and tried to create the function to expand all nodes .
    But I do not know how to use the action OnExpandAll .
    I can see the button to start action OnExpandAll on the head of Tree .
    I am trying to write logic in the action . But it does not work successfully .
    (In my tree , when I click the button for OnExpandAll , all nodes are outputted on root node .
    Because my logic is wrong ... )
    Please give me any hints .
    Masao

    Hi
    As your case it is a recursive node.
    then you have to create method and call it recursively for the expanall functionality.
    do it like this.
    create an attribute the node FOLDER
    name = 'ISEXPANDED'
    type = WDY_BOOLEAN.
    Now bind the property expanded of treenode FOLDER UI to this attribute.
    now go to the methods tab and create one method say name ZEXPANDALL.
    in thsi method make one importing parameter of type ( type ref to ) if_wd_context_node. and name NODE.
    then write the following code in this method.
    method ZEXPANDALL .
    DATA ELT TYPE WDR_CONTEXT_ELEMENT_SET.
    DATA EL TYPE REF TO IF_WD_CONTEXT_ELEMENT.
    data nd type ref to if_wd_context_node.
    data nds type WDR_CONTEXT_CHILD_MAP.
    data chld type wdr_context_child.
    data nf type ref to if_wd_context_node_info.
    data name type string.
    ELT = node->GET_ELEMENTS( ).
    LOOP AT ELT INTO EL.
      EL->SET_ATTRIBUTE(
      NAME = 'ISEXPANDED'
      VALUE = ABAP_TRUE
      data parent_key type string.
    EL->get_attribute( exporting name = 'TEXT' importing value
    = parent_key ).
    * create the child nodes
        create_node(
          exporting
            cur_element = EL
            parent_key  = parent_key ).
    nds = el->get_child_nodes( ).
    loop at nds into chld.
      nd ?= chld-node.
      nf = nd->get_node_info( ).
    name  = nf->get_name( ).
    if name eq 'FOLDER'.
      zexpandall(                             "recursive call
      nd
    endif.
      endloop.
      ENDLOOP.
    endmethod.
    NOw go to your eventhandler created for action expandall.
    there write the following code.
    method ONACTIONEXPANDALL .
    DATA lo_nd TYPE REF TO if_wd_context_node.
      lo_nd = wd_context->get_child_node( 'FOLDER' ).
      ZEXPANDALL( lo_nd ).
    endmethod.
    thats it.
    Thanks
    sarbjeet singh

  • Tree Structure Expansion - BSP Element "TREE"

    When I expand a node of a tree in one of my views viz Organization View, then the scroller comes in case there are more nodes than the view can accept at a time.
    Now if I scroll down and again click on one of the nodes in the tree then that node expands which is alright, but the scroller goes to the top. This causes the inconvenience to again scroll down then see the entries in the last expanded node.
    So is there anyway that I can remain over the same node which is expanded even though there is a scroller.
    For some information, I am using the CRMIC tag "tree" with the following attributes -
    id
    iterator
    keyColumn
    multiSelect
    nodeTable
    nodeTextColumn
    nodeTextColumnDescription
    onCollapseNode
    onExpandNode
    onNodeClick
    onRowSelection
    selectedRowIndex
    selectedRowIndexTable
    selectedRowKey
    table
    visibleFirstRow
    visibleRowCount
    Regards.

    Hi Bharat ,
    Thanks for the reply.
    Yes you are right, we don't have button on each level. I will try to take the example which you have taken with one extra level.
    Main level 1
    Header Level 1.
    Level 1.
    Level 2.
    Header Level 2.
    Level 1.
    Level 2.
    Level 3.
    Main level 2
    Header Level 1.
    Level 1.
    Level 2.
    Level 3.
    Main level 3
    Header Level 1.
    Level 1.
    Level 2.
    So in above example, we have three levels.
    1st Level: Main level
    2nd Level: Header Level
    3rd Level: Level
    Now my requirement is,  Let's say user will select Header Level 1 of Main Level 2. And user wants to add  Level 4 just below the level 3 of this level.
    Then generally we have the supply method, where we collect the data for each and every level. bu in this case I am not able to get, how can I modify this level?
    Thanks!
    Regards
    PG

  • WDA:  Tree structure in web dynpro for ABAP

    Hi,
    I am trying to build a tree structure with information something like the following:
    Country
    State
    City
    I used the UI Element "Tree" and I was successful in building it. The only problem is that it supports only one column in each row like name.
    I need multiple columns in each row like Name and population.
    1) Is there any solution for this using UI element "Tree" only?
    2)I checked that there is Table tree UI element, but I could not figure out how I could use it for hierarchial structure like that of my requirement? Can I use it? Is there any example application with hierarchial structure?
    3)For tree UI element, any node that is not directly below context node has to be non-singleton. It will lead to adverse performance. Is there any solution for this?
    Thanks in advance.
    Regards,
    Srini.

    Hi Srinivasa,
    In the context, please create a node DATA with the following fields:
    KEY type string
    PARENT type string
    LOCATION type string
    POPULATION type string (or "I" if you happen to have numbers only without a unit like "k" for "thousand").
    Then please create a table with a TreeByKeyTableColumn namde LOCATION and an additional TableColumn called POPULATION. Now please add a TextView cell editor to both and bind the text value of each of them to the attributes LOCATION and POPULATION of the context node DATA. Last step is to bind the attribtues rowKey and parentRowKey(?) to the KEY and the PARENT attributes. This concludes the design time part.
    Next step is to fill the node DATA with actual data. Just use a supply function and do it like this:
    First entry:
    KEY = 'WORLD'.
    PARENT = ''.
    LOCATION = 'World'.
    POPULATION = '4 billion'.
    Second entry:
    KEY = 'DE'.
    PARENT = 'WORLD'.
    LOCATION = 'Germany'.
    POPULATION = '80 million'.
    You should now see a table with a tree at the left column that looks like:
    <pre>
      World        4 billion
       ->Germany   80 million
    </pre>
    Kind regards,
    Thomas
    Message was edited by: Thomas Szuecs

  • ABAP WebDynPro User Interface Elements not shown on layout while designing

    Hi,
    When I create a new custom ABAP WedDynpro, the UI Element library is not shown on the view layout.
    I have tried a lot of options in exploring this.
    Kindly help me
    Thanks
    Sai.

    Have you followed the instructions in the online help:
    For the layout editor in the View Designer, all the services specified in Active Services in SICF for Web Dynpro ABAP must be activated. More information: SAP Notes 1009930 and 1008689
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/43/e86de5008b4d9ae10000000a155369/frameset.htm
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/46/d28dfa34bb12bee10000000a1553f7/frameset.htm
    The view designer is a web application itself and your system must be properly setup for web access for this to work.  Also look at your Fully Qualified Domain Name setup:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/67/be9442572e1231e10000000a1550b0/frameset.htm
    Although a nice feature, the view deisgner is not required for building Web Dynpro Applications.  You can do 100% of the activities with the view designer turned off by working with the UI element tree on the right side of the page.  You can right mouse click and use the context menu to access most functions.  I'm sure that you want to get the view designer working, but until then you can still function.

  • Expand tree in WebDynpro ABAP application

    Hi,
    Currently I am working on a WDA application which contains a UI ELEMENT TREE. The tree is generated dynamically at runtime.
    I was guided by the example of SAP "WDT_TREE". After generating the tree looks like this:
    TREE
       | __ NODE1
               | __ LEAF1
               | __ LEAF2
               | __ NODE2
                    | __ LEAF3
               | __ Node3
                    | __ LEAF4
                    | __ LEAF5
                    | __ LEAF6
    Now I have bound the "expanded" property of the node to a context element and execute the following action in the WDDOINIT:
    * Fill tables with the structure of the tree
      fill_foldertable( ).
      fill_filetable( ).
      lr_current_node    = wd_context->get_child_node( 'FOLDER' ).
      lr_current_element = lr_current_node->create_element( ).
      lr_current_node->bind_element( lr_current_element ).
      lr_current_node->set_lead_selection( lr_current_element ).
      lr_current_element->set_attribute( name = 'TEXT' value = 'Products' ).
    lr_current_element->set_attribute( name = 'IS_EXPANDED' value = 'X' ).
    * Create the root node
      create_node(
        EXPORTING
          cur_element = lr_current_element
          parent_key  = 'Categories' ).
    Now the tree is expanded, but i can't see EAF1 and LEAF2. I get them only by clicking again on node1.
    Any ideas?
    Regards.

    Hi All,
    I found the solution for my question.  Expand tree in Webdynpro application
    Soultion
    In the context node i.e used as a source for tree, you create a attribute
    Attribute Name: IS_BOOLEAN
    Attribute type : WDY_BOOLEAN
    Default Value : X
    And in Context node Un check the Initialization lead selection.
    Now bind the Expand property of TreeNodeType with 'IS_EXPAND' which you have created just now.
    This way the whole tree will be expanded.
    Regards,
    Pavan Maddali

  • Element: Why can't I insert into HTMLDocument?

    I am trying to insert a String into an HTMLDocument. I do not understand why it does not work.
    The followung is my code:
         *  Appends some text in formatted form to a document.
         *  @param text the text to be added
         *  @param doc the HTML document to which to add the text
         *  @return the same document as was passed into the method as an argument,
         *  with new formatted text appended to it
        public Document addStylized(String text, Document doc) {
            StringTokenizer tokenizer = new StringTokenizer(text, "{}", true);
            Style style = contentStyle;
            Element rootElement = doc.getRootElements()[0];
         Element bodyElement = rootElement.getElement(rootElement.getElementIndex(0));
         HTMLDocument htmlDoc = (HTMLDocument) doc;
            while (tokenizer.hasMoreTokens()) {
                String token = tokenizer.nextToken();
                if (token.equals("{")) {
                    token = tokenizer.nextToken();
                    try {
                        htmlDoc.insertBeforeEnd(bodyElement, "<a href=\"" + token +
                                "\">" + token + "</a>");
                    } catch (Exception e) {
                        e.printStackTrace();
                        System.exit(1);
                    tokenizer.nextToken(); // token should be "}" now
                } else {
              try {
                  htmlDoc.insertBeforeEnd(bodyElement, token);
              } catch (Exception e) {
                  e.printStackTrace();
                  System.out.println("token: " + token);
                  System.exit(1);
            return doc;
        }The following is what I get at runtime:
    javax.swing.text.BadLocationException: Invalid insert
            at javax.swing.text.GapContent.insertString(GapContent.java:109)
            at javax.swing.text.DefaultStyledDocument.insert(DefaultStyledDocument.java:187)
            at javax.swing.text.html.HTMLDocument.insert(HTMLDocument.java:230)
            at javax.swing.text.html.HTMLDocument$HTMLReader.flushBuffer(HTMLDocument.java:3185)
            at javax.swing.text.html.HTMLDocument$HTMLReader.flush(HTMLDocument.java:2049)
            at javax.swing.text.html.HTMLDocument.insertHTML(HTMLDocument.java:1143)
            at javax.swing.text.html.HTMLDocument.insertBeforeEnd(HTMLDocument.java:914)
            at quikdic.DICTStylizer.addStylized(DICTStylizer.java:81)
            at quikdic.QuikDicFrame$DefinitionThread.run(QuikDicFrame.java:659)The document passed into the method is an HTMLDocument which has been created with (HTMLDocument) htmlEditorKit.createDefaultDocument();Why am I getting the above error?

    Hi,
    I am not sure if the way you get the BODY tag element is correct in your code. You could use something like the following instead (hd being your HTMLDocument object):
        Element link = findElement(hd.getDefaultRootElement(), HTML.Tag.BODY.toString());
       * find the first occurrence of an <code>Element</code> in the
       * element tree below a given <code>Element</code>
       * @param parent the <code>Element</code> to start looking
       * @param name the name of the <code>Element</code> to search for
       * @return the found <code>Element</code> or null if none is found
      private Element findElement(Element parent, String name) {
        Element foundElement = null;
        Element thisElement = null;
        int count = parent.getElementCount();
        int i = 0;
        while(i < count && foundElement == null) {
          thisElement = parent.getElement(i);
          if(thisElement.getName().equalsIgnoreCase(name)) {
            foundElement = thisElement;
          else {
            foundElement = findElement(thisElement, name);
          i++;
        return foundElement;
      }Hope that helps
    Ulrich

  • WD Abap - Tree

    hi folks,
    i'm working with the Element TREE and now i'm wondering if it is possible to build a tree like that (similar to the tree in sapgui abap):
    node
    -subnode
       -subnode  Item1 Item2 Item3
    Because all my Item-Fields are always in the next row after the subnode?
    kind regards oliver

    Hi Oliver,
    >I guess the Nesting Tree in a Table could work, am i right?
    Yes. Another option would be to use the *ByKey version of the hierarchy column. Using it, you don't need to have a recursive nodes in the context, but a only a single non-recursive one. The parent relationship needs to be expressed via two attributes of this node, one containing the id of the current item and the other one the id of the parent under which it will appear once rendered (there are corresponding attributes in the ui elements, which have to be bound). Btw. There is no need to order the elements concerning their parent relationship. The renderer does that automatically.
    Kind regards,
    Thomas

  • Web Dynpro, Tree

    Hi all,
    I implemented a recursive tree using the UI Element Tree. My customer wants to see this tree expanded up to the second level on the start of the view.
    Is there a possibility to manage it (expand 2 levels of the tree) in my ABAP program or somehow else?
    Kind regards,
    Oleksandr

    Hi,
    Refer this online help: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/21/ad884118aa1709e10000000a155106/content.htm
    Also refer this standard component: WDR_TEST_EVENTS. Look for the tree views.
    I hope it helps.
    Regards
    Arjun

  • How to access XML elements by name in Extendscript??

    I'm almost done the script that I've been working on, but something has been nagging me since I started. When I did start, I looked at the JS Tools Guide CS5 that comes with the extendscript ide to check how to access XML elements, children, attributes etc. It says this:
    The XML object represents an XML element node in an XML tree. The topmost XML object for an XML file
    represents the root node. It acts as a list, which contains additional XML objects for each element. These in
    turn contain XML objects for their own member elements, and so on.
    The child elements of an element tree are available as properties of the XML object for the parent. The
    name of the property corresponds to the name of the element. Each property contains an array of XML
    objects, each of which represents one element of the named type.
    So basically it converts the XML into JSON. And you can access the properties like so:
    <book category="COOKING">
         <title lang="en">The Boston Cooking-School Cookbook</title>
         <author>Fannie Merrit Farmer</author>
         <year>1896</year>
         <price>49.99</price>
    </book>
    The Javascript statement bookstoreXML.book; returns the entire list of books.
    The statement bookstoreXML.book[0]; returns the XML object for the first book.
    The statement bookstoreXML.book[0].author; returns all authors of the first book.
    A couple pages down it talks about Retrieving contained elements using children(), elements(), descendants().
    So now I look through the XML Object properties and I see that I can use:
    xmlObj.child (which) which A String, the element name, or a Number, a 0-based index into this node’s child array.
    or
    xmlObj.descendants ([name])
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    or
    xmlObj.elements (name);
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    This is an excerpt of an XML I was working with:
    <ROW xmlns="http://www.filemaker.com/fmpdsoresult"
         MODID="16"
         RECORDID="11128">
       <Sign_Type>251.dr</Sign_Type>
       <fm:Location xmlns:fm="http://www.filemaker.com/fmpdsoresult" xmlns="">5-5024</fm:Location>
       <Line1>Zone
    Floor
    3
    Patient Rooms
    R532 - R436 even
    Patient Rooms
    R522 - R446 even
    Xavier Elevators
    Zone
    Patient Rooms
    R537 - 5757 odd
    Main Elevators
    Zone</Line1>
    </ROW>
    Extendscript will not give me an anything when I try to access elements by name. Instead I have to access by index, which works, but I'd rather search for names!
    Actually the console log returns: <![CDATA[]]>
    What am I doing wrong!?

    First, those E4X XML objects are definitely no JSON (plain data) - they have a multitude of methods, even for tasks that would easily be implemented as property (e.g. the length() function), and they also bind xml element and attribute names onto the objects, allowing to target a multitude of XML nodes with a single statement. Or did you mean your script with that "it"?
    Anyway, as you found out the ExtendScript XML object handles namespaces mostly by hiding them from you.
    You could play around with global namespace settings, see the JavaScript tools guide.
    You could also explicitly specify a namespace. This works for me:
    $.writeln(myXML["fm:Location"]);
    For simple use I had most success with a brute force approach that just strips the namespaces.
    function removeAllNamespace(xml)
              var ns =new Namespace();
              var d=xml.descendants();
              for (var i=0;i<d.length();i++)
        d[i].setNamespace(ns);

  • Wordwrap in tree

    Hello,
    I use the htmlb element 'tree' and I want to wrap the text of a node. Around the tree I have the htmlb element 'tray' to show and hide the tree. At the moment the tree expands its size depending on the node's text length. As I have only limited space for the tree I want to wrap the tree node text.
    Thanks in advance!
    Stefan

    It is unfortunately so that the group that does the design of the SAP tree specified nowrap as the way the world should be.
    This problem has been discussed in detail recently (see link from Dany). As you are new to the forum, let me recommend reading <a href="/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help">Getting Help</a> text. Specifically the technique to back search the forum helps to quickly get up to speed.

  • Click tree outside the nodes thows  NullPointerException.

    private void doMouseClicked(java.awt.event.MouseEvent evt) {                               
    TreePath tp= AATree.getPathForLocation(evt.getX(),evt.getY());
    String nodeStr = "";
    try {
    nodeStr = tp.toString().
    catch(NullPointerException e) {
    e.printStackTrace();
    System.out.println(nodeStr);
    when i click the blank space of jtree outside the nodes I catch NullPointerException. How can I get rid of it?
    Thanks a lot.

    Verify if Tree.dataSource and TreeNodeType.dataSource are bound to the context node providing the tree data (not the recursive subnode).
    Context:
    TreeNode
    -- Attribute1
    -- Child (recursive subnode)
    UI element:
    Tree
    -- TreeNodeType
    Tree.dataSource = TreeNode
    TreeNodeType.dataSource = TreeNode
    TreeNodeType.text = TreeNode.Attribute1
    Armin

  • How to retrieve data from the HTML form in the JEditorPane?

    I could quite easily use JEditorPane to render and display a simple HTML file.
    My HTML looks like this:
    <html>
    <head>
    <title> simple form</title>
    </head>
    <body bgcolor="cccccc">
    <center><h1>SURVEY THING</h1>
    </center>
    <form id="survey">
    <p>1.Type something in.</p>
    <textarea cols=25 rows=8>
    </textarea>
    <BR>
    <p>2.Pick ONLY one.</p>
    <input type="radio" name="thing" value="0" Checked> NO choice <BR>
    <input type="radio" name="thing" value="1"> First choice <BR>
    <input type="radio" name="thing" value="2"> Second choice
    <BR>
    <p>3.Pick all you like.</p>
    <input type="checkbox" name="stuff" value="A"> A <BR>
    <input type="checkbox" name="stuff" value="B"> B <BR>
    <input type="checkbox" name="stuff" value="C"> C <BR>
    <input type="submit" value="give data">
    <input type="reset" value="do clensing">
    </form>
    </body>
    </html>
    It gets diplayed fine and I can type in text, select radio buttons (they behave mutualy-exclusive,
    as they should) and check checkboxes.
    The problem I have is with retrieving the values which were entered into the form.
    If I, after editing, try to write the html to the file using HTMLWriter,
    it records the changes I made into the textarea, however all the radio and checkbox selections are lost.
    Maybe the problem is that when I enter the values I do not use any methods like
    insertBeforeStart and so on, but I believe I shouldn't need to use them to populate a form.
    Especially I never change the structure of the HTML.
    Also, when I try to traverse the Element tree and see the input elements attributes,
    I can never see a change in the entered values. However it is probably b/c I am traversing through
    the model and the changes are in the view (just a guess.)
    Anyway, if anybody could direct me onto the right path: how to retrieve the values typed in the form,
    or if it is possible at all in the JEditorPane, I would greatly appreciate.
    thanks
    maciej
    PS. I have seen the answer to a similar question posted some time last year. However, I am trying
    to find a soultion which allows forms/surveys to be built by people who have no java and only basic
    html knwledge. And Axualize way is probably a little bit too "high-tech."

    Maybe helpful for u.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Container;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    public class TestHtmlInput extends JFrame {
         JEditorPane pane=new JEditorPane();
         public TestHtmlInput() {
              super();
              pane.setEditorKit(new HTMLEditorKit());
              pane.setText("<HTML><BODY><FORM>" +
              "<p>1.Input your name.</p>" +
              "<INPUT TYPE='text' name='firstName'>" +
              "<p>2.Input your information.</p>" +
              "<TEXTAREA rows='20' name='StationDescriptions' cols='100'>" +
              "<p>3.Pick ONLY one.</p>" +
              "<input type='radio' name='thing' value='0' Checked> NO choice <BR>" +
              "<input type='radio' name='thing' value='1'> First choice <BR>" +
              "<input type='radio' name='thing' value='2'> Second Choice <BR>" +
              "<p>4.Pick all you like.</p>" +
              "<input type='checkbox' name='stuff' value='A'> A <BR>" +
              "<input type='checkbox' name='stuff' value='B'> B <BR>" +
              "<input type='checkbox' name='stuff' value='C'> C <BR>" +
              "<p>5.Choose your nationality.</p>" +
              "<select name='natio'>" +
              "<option>12</option>" +
              "<option selected>13</option>" +
              "</select>" +
              "</FORM></BODY></HTML>");
              this.getContentPane().add(new JScrollPane(pane));
              JButton b=new JButton("print firstName text");
              b.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        System.out.println("Number of Components in JTextPane: " + pane.getComponentCount());
                        for (int i = 0; i <  pane.getComponentCount(); i++) {
                             //NOTE FOR BELOW: know its a Container since all Components inside a JTextPane are instances of the inner class
                             //ComponentView$Invalidator which is a subclass of the Container Class (ComponentView$Invalidator extends Container)
                             Container c = (Container)pane.getComponent(i);
                             //the component of this containers will be the Swing equivalents of the HTML Form fields (JButton, JTextField, etc.)
                             //Get the # of components inside the ComponentView$Invalidator (the above container)
                             Component swingComponentOfHTMLInputType = c.getComponent(0);
                             //each ComponentView$Invalidator will only have one component at array base 0
                             //DISPLAY OF WHAT JAVA CLASS TYPE THE COMPONENT IS
                             System.out.println(i + ": " + swingComponentOfHTMLInputType.getClass().getName());
                             //this will show of what type the Component is (JTextField, JRadioButton, etc.)
                             if (swingComponentOfHTMLInputType instanceof JTextField) {
                                  JTextField tf = (JTextField)swingComponentOfHTMLInputType;
                                  //downcast and we have the reference to the component now!! :)
                                  System.out.println("  Text: " + tf.getText());
                                  tf.setText("JTextField found!");
                             } else if (swingComponentOfHTMLInputType instanceof JButton) {
                             } else if (swingComponentOfHTMLInputType instanceof JComboBox) {
                                     JComboBox combo = (JComboBox)swingComponentOfHTMLInputType;
                                     System.out.println("  Selected index: " + combo.getSelectedIndex());
                                } else if (swingComponentOfHTMLInputType instanceof JRadioButton) {
                                     JRadioButton radio = (JRadioButton)swingComponentOfHTMLInputType;
                                     System.out.println("  Selected: " + new Boolean(radio.isSelected()).toString());
                             } else if (swingComponentOfHTMLInputType instanceof JCheckBox) {
                                     JCheckBox check = (JCheckBox)swingComponentOfHTMLInputType;
                                     check.setSelected(true);
                                     System.out.println("  Selected: " + new Boolean(check.isSelected()).toString());
                             } else if (swingComponentOfHTMLInputType instanceof JScrollPane) {
                                  JScrollPane pane = (JScrollPane)swingComponentOfHTMLInputType;
                                  for (int j=0; j<pane.getComponentCount(); j++) {
                                       //JTextArea area = (JTextArea)swingComponentOfHTMLInputType.getComponent(0);
                                       Container c2 = (Container)pane.getComponent(j);
                                       for (int k=0; k<c2.getComponentCount(); k++) {
                                            Component c3 = (Component)c2.getComponent(k);
                                            if (c3 instanceof JTextArea) {
                                                 JTextArea area = (JTextArea)c3;
                                                 System.out.println("  " + area.getClass().getName());
                                                 System.out.println("     Text: " + area.getText());
                                                 area.setText("JTextArea found!");
                             } else {
              this.getContentPane().add(b,BorderLayout.SOUTH);
         public static void main(String args[]) {
              TestHtmlInput app = new TestHtmlInput();
              app.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              app.setSize( 400, 900 );
              app.setVisible( true );
    }

Maybe you are looking for

  • How do you copy your iphoto library to ext. hard drive?

    I am sorry to ask this lame question, but: How do you copy your iPhoto library to an external hard drive, just to back it up? I'm confused, because of three things: a) I can't seem to find, in iPhoto pref's, where you select what the "path" is to the

  • GR against Contract

    Hi Experts, Is it possible to do GR against contract? My client want to receive the material from Vendors on Verbal Orders, How about if we maintain a contract as there is no PO, Regards Meh

  • Output Service invocation with webservices

    Hello, I want to invoke the output service with a Java Client using webservices. I have generated the proxy Java classes using Apache Axis, and then I wrote a Java Client invoking the output service, using a simple form (xdp file) and a data xml file

  • Frm-99999 problem

    hi everybody i got a java error "java.lang.noclassdeffounderror" while trying to open my static web page using the internet explorer v4, i'm using OAS 4.0.8.1 and oracle developer server ver 6.0.5 installed on one machine called my_app_server , my or

  • Convert from Non-RAC to RAC-What should be the approach?

    Hi All, We have a single node installation with EBS 11.5.10.2 and 9iR2 db. Our requirement is to upgrade the db to 10gR2 and implement RAC. I am really confused as to how should we proceed with this. 1.If we upgrade the database to 10g first,can it b