Acess child node elements

Hi Experts,
I have a child node B in node A . This node B has singleton property false .
I have to acess current element of child node B  while looping on node A .
Please Help.
Thanks in advance ,

Hello Hara,
try this:
final IPrivateXXX.INodeANode nodeA = wdContext.nodeNodeA();
final int sizeA = nodeA.size();
for (int i = 0; i< sizeA; i++)
     final IPrivateXXX.INodeAElement element = (IPrivateXXX.INodeAElement)nodeA.getElementAt( i );
     final IPrivateXXX.INodeBNode nodeB = element.nodeNodeB();
     //current element in nodeB
     final IPrivateXXX.INodeBElement currentChildElement = nodeB.currentNodeBElement();
     //and just in case - the rest...
     final int sizeB = nodeB.size();
     for (int j = 0; j< sizeB; j++) {
          final IPrivateXXX.INodeBElement childElement = (IPrivateXXX.INodeBElement)nodeB.getElementAt( j );
          //do action with child element
Best regards, Maksim Rashchynski.

Similar Messages

  • Mapping problem of Child Node elements as per Parent Node conditions

    Hi,
    I have an IDOC to SOAP scenario,I have to map the following fields of IDOC,
    E1EDPT1 (0..999..)
    _TDID (0..1)
    _ E1EDPT2 (0..999..)
    _  TDLINE (0..1)
    Whenever I have the element TDID = Z011, I have to map the element TDLINE to the target Message Type AVL_QTY , which is as below (any one)
    ITEM_TEXTS (0..unbounded)
    _ ITEM_TEXT (0..unbounded)
                   |_  AVL_QTY (0..1)
    I have done a graphical mapping where the Node ITEM_TEXTS is created only if the above condition is met, ITEM_TEXT and AVL_QTY are mapped directly to E1EDPT2 and TDLINE.
    This works for only one item, it fails for multiple.
    Please suggest a solution...
    Thanks and Regards,
    Rohit.

    Hello,
    Thanks for the above suggestion!
    But still the problem exits.
    I have currently mapped the field in such a way that it gives proper solution but every item i.e. E1EDP01 segment must have an E1EDPT1 segment with element TDID = Z011.
    Mapping in Text View looks like below:
    /ns0:MT_CONTRACT_DOWNLOAD_MOnline/CONTRACT_ITEM/AVL_QT=addCorresponding(removeContexts(index(ifWithoutElse(stringEquals(/ORDERS05/IDOC/E1EDP01/E1EDPT1/TDID, const(value=Z011)), /ORDERS05/IDOC/E1EDP01/E1EDPT1/E1EDPT2/TDLINE, keepss=false), start=1, inc=1, type=0, result)), removeContexts(ifWithoutElse(stringEquals(/ORDERS05/IDOC/E1EDP01/E1EDPT1/TDID, const(value=Z011)), /ORDERS05/IDOC/E1EDP01/E1EDPT1/E1EDPT2/TDLINE, keepss=false)), result)
    UDF for addCorresponding method:
    int flg=0;
    for (int i=0; i<indexes.length; i++)
        if(! indexes<i>.equals("1"))
                   result.addValue(tdTexts<i>);
         else
              if(flg == 0)
                        result.addValue(tdTexts<i>);
                        flg = 1;
              else
                             result.addContextChange();
                             result.addValue(tdTexts<i>);
    Suppose if there are 3 items, the above condition is met in 1st and 3rd item, and if the 2nd item has TDID = Z008, then in the output i get three item values with the TDLINE values in the first two items itself, it doesnt recognise that 2nd item hasnt matched the condition.
    Thanks and Regards,
    Rohit.

  • HI Can I add a child node to an Element Node with a name that  exists

    HI,
    Can I add a child node to an Element Node with a name that is already existing in the Element Node.
    Let me explain what I need exactly.
    My Existing element Node looks like this:
    <form>
    <name>
    <FirstName></FirstName>
    <LastName></LastName>
    </name>
    </form>
    Can I add another child node with hte name 'FirstName' to the 'name' node ..?
    I want to put a attribute rvsn with a value 1 for the original 'FirstName' element Node.
    so the new Element Node should look like the foloowing:
    <form>
    <name>
    <FirstName rvsn="1"></FirstName>
    <FirstName></FirstName>
    <LastName></LastName>
    </name>
    </form>
    Hopefully this is valid XML !!
    when I tried to use appendChild, it removed the previous node and put the new one. Thats what is the documentation also said.. I read it after I tried it :(
    Anyway, ther should be another way to add a node like that.
    Any hints, ideas will be of great help.
    -Thanks in advance !!
    Murthy

    // this method will start marking the old values with a revision number.
         private void saveNodeDetails (Node node) {
    String Content = "";
    String nodeName = "";
    int rvsn = getRvsn();
    int type = node.getNodeType();
    int tempRvsn = 0;
    String tempNodeName = "";
    String tempParentNodeName = "";
    Node tempParentNode = null;
    // check if element
    if (type == Node.ELEMENT_NODE) {
    Node traverseNode = node;
    nodeName = getNodeName(traverseNode);
    if (nodeName != null && nodeName.trim().length() > 1)
    nodeName = nodeName.substring(0, nodeName.length() - 1);
    if (_debug)
    System.out.print("2. ELEMENT_NODE name## " + nodeName);
    // if the element has no children, its leaf node.
    // if its there in the Hashtble, then update the value from the hashtable.
    if (reqParams.containsKey(nodeName)) {
    if (_debug) System.out.println("3. Hash Value = " + reqParams.get(nodeName).toString());
    if (traverseNode == null)
    if (_debug) System.out.println("3A. traverseNode == null ");
    if (node == null)
    if (_debug) System.out.println("3B. node == null ::(((((");
    // get the node children
    NodeList children = node.getChildNodes();
    // end of getting children for the Node.
    if (_debug) System.out.println("4. Got ChildNodes ");
    if (children != null) {
    int length = 0;
    length = children.getLength();
    if (_debug) System.out.println("5. Got children Length = " + length);
    if( ((Element) node).hasAttribute("rvsn") ){
    System.out.println(" node has Attribute(rvsn) ");
    tempRvsn = Integer.parseInt( ((Element) node).getAttribute("rvsn") );
    if( tempRvsn == rvsn){
    // user is changing the same data again and again.
    // so remove the text node and append the new value as text node finally
    for (int index = 0; index < length; index++) {
    if (_debug) System.out.println("6. index = " + index);
    if (_debug) System.out.println(index + ": children.item( index )@saveNodeDetails@ContainerDoc = " + children.item(index).getNodeType() + " -- " + children.item(index).getNodeValue());
    if (children.item(index).getNodeType() == Node.TEXT_NODE)
    node.removeChild(children.item(index));
    }else{
    int l= 0; // do not do any thing if the current node rvsn is different from the rvsn of the DOM
    // programme logic could enter this part when ther are multiple revisions of the NODe in the DOM,
    // and we are traversing through the previous versions of it.
    } else{
    System.out.println(" node has no Attribute(rvsn) ");
    // the node has no rvsn attribute.
    // it is the initial version of the dom.
    // add the rvsn from the DOM to this NODE for the first time.
    ((Element) node).setAttribute("rvsn", (new Integer(rvsn)).toString() );
    // get parent node and add a new child node with the same name as current node.
    // so parent node will have the previous node with a rvsn and a new node without the rvsn !!
    tempNodeName = node.getNodeName();
    tempParentNode = node.getParentNode();
    tempParentNodeName = tempParentNode.getNodeName();
    System.out.println(" adding node: " + tempNodeName + " to : " + tempParentNodeName);
    node = addNode(tempParentNode, tempNodeName, "");
    getNodeName(node); // print the name of the node after modifying it !!!
    printSiblings(node);
    //System.out.println(" After adding the node : " + getNodeName(node));
    } else if (_debug) {
    System.out.println("7. Node name exist in the Hash but has no children to be removed..!!:: @saveNodeDetails ");
    if (_debug) System.out.println("7B. Update the dom from the hash value " + nodeName + ", " + reqParams.get(nodeName).toString());
    node.appendChild(document.createTextNode(reqParams.get(nodeName).toString()));
    if (node != null) {
    if ( ( (Element) node).hasAttribute("rvw"))
    ( (Element) node).removeAttribute("rvw");
    if ( ( (Element) node).hasAttribute("msg"))
    ( (Element) node).removeAttribute("msg");
    if ( ( (Element) node).hasAttribute("dor"))
    ( (Element) node).removeAttribute("dor");
    }// end of if (type == Node.ELEMENT_NODE)
    NodeList children = node.getChildNodes();
    if (children != null) {
    for (int i = 0; i < children.getLength(); i++) {
    saveNodeDetails(children.item(i));
         } // end of saveNodeDetails method
    public Node addNode(Node parentNode, String nodeName, String value){
    Node newNode = null;
    try{
    newNode = parentNode.appendChild( document.createElement(nodeName) );
    newNode.appendChild( document.createTextNode( value ) );
    }catch(Exception Ex){
    System.out.println("2. Exception@addNode@ContainerDoc = " + Ex);
    return newNode ;
    } // end of addNode method

  • Regarding : Creation of child nodes in a outlinefield

    Hi,
    I am facing a few problems in creating a child node. I read elements from an array to populate the outline field. The array has exact definitions as to what should be a parent and child respectively. While I am able to create nodes at the parent level, I am unable to create child nodes for any parent. I discovered that the value for the parent node is getting lost. I have tried to use some of the methods to arrive at the parent node, but to no anvil. Could some one suggest how exactly to get the value of the parent node so that the child node can be assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No clues from here.

    I take it that you are traversing through the array and loading each
    element into the OutlineField. At the risk of stating the obvious, for
    each element you must also identify it's parent. This is necessary to
    set the relationship from the child to the parent or vise versa.
    If you are already doing this and are still having difficulty, the
    problem may be as simple as setting the IsFolder property of the parent
    node. Unless this is done, it's child nodes will not be visible.
    Van Vuong
    Lead Technical Analyst
    Office: 972.985.5289
    VoiceNow: 972.330.0822
    Internet: [email protected]
    PAGE NET
    From: bala[SMTP:[email protected]]
    Sent: Friday, October 03, 1997 12:32 PM
    To: '[email protected]'
    Subject: Regarding : Creation of child nodes in a outline field
    Hi,
    I am facing a few problems in creating a child node. I read elements from an
    array to populate the outline field. The array has exact definitions as to
    what should be a parent and child respectively. While I am able to create
    nodes at the parent level, I am unable to create child nodes for any parent.
    I discovered that the value for the parent node is getting lost. I have
    tried to use some of the methods to arrive at the parent node, but to no
    anvil. Could some one suggest how exactly to get the value of the parent node
    so that the child node can be assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No
    clues from here.

  • RE: Regarding : Creation of child nodes in a outlinefield

    Hi, Balasubramaniam:
    Try to set the isFolder attribute of your parent display node to TRUE.
    This may solve your problem. Also, check isFilled attribute of display
    node, you might find the answer.
    Hope this helps.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x233
    Fax 201.261.1399
    E-mail : [email protected]
    -----Original Message-----
    From: owner-forte-users [SMTP:[email protected]]
    Sent: Friday, October 03, 1997 5:32 PM
    To: '[email protected]'
    Subject: Regarding : Creation of child nodes in a outline field
    Hi,
    I am facing a few problems in creating a child node. I read elements =
    from an array to populate the outline field. The array has exact =
    definitions as to what should be a parent and child respectively. While =
    I am able to create nodes at the parent level, I am unable to create =
    child nodes for any parent. I discovered that the value for the parent =
    node is getting lost. I have tried to use some of the methods to arrive
    =
    at the parent node, but to no anvil. Could some one suggest how exactly =
    to get the value of the parent node so that the child node can be =
    assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No
    =
    clues from here.

    I take it that you are traversing through the array and loading each
    element into the OutlineField. At the risk of stating the obvious, for
    each element you must also identify it's parent. This is necessary to
    set the relationship from the child to the parent or vise versa.
    If you are already doing this and are still having difficulty, the
    problem may be as simple as setting the IsFolder property of the parent
    node. Unless this is done, it's child nodes will not be visible.
    Van Vuong
    Lead Technical Analyst
    Office: 972.985.5289
    VoiceNow: 972.330.0822
    Internet: [email protected]
    PAGE NET
    From: bala[SMTP:[email protected]]
    Sent: Friday, October 03, 1997 12:32 PM
    To: '[email protected]'
    Subject: Regarding : Creation of child nodes in a outline field
    Hi,
    I am facing a few problems in creating a child node. I read elements from an
    array to populate the outline field. The array has exact definitions as to
    what should be a parent and child respectively. While I am able to create
    nodes at the parent level, I am unable to create child nodes for any parent.
    I discovered that the value for the parent node is getting lost. I have
    tried to use some of the methods to arrive at the parent node, but to no
    anvil. Could some one suggest how exactly to get the value of the parent node
    so that the child node can be assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No
    clues from here.

  • How to assign ALV for parent node and child node that uses supply method.?

    HI Dear friends,
        I need to display header details ( VBAK ) and Item details ( VBAP ). I have created two node like HEADER_NODE inside this i have created ITEM_NODE for this item node i use supply function 'GET_ITEMS'  any way it is working only when crete two separate table and binding but when i come to work with ALV i am totally confused .. i have created two 'View Controller UI Elements'   when i try to map HEADER_NODE  it mapped properly but for ITEM_NODE it shows mapping already defined. return status message as 'Action Cancelled' . In result both ViewContainer shows only HEADER_NODE data only.
    How to achive ALV for  Parent, child node that uses supply function ? ?
    Thank you

    Delete Mapping is not enabled, that means there is no mapping done yet.
    I just tried what you are saying and the application works and i am able to map the header table and item table and also again i could map the tables any number of times.. i didn't get any such message, sorry i couldn't recreate the scenario. might be there is something wrong in the context.
    i just did it like this.
    Please also move this to Web DynPro Discussion, Hope that would be helpful.
    Message was edited by: Syed Ghulam Ali

  • How to store multiple child nodes using dbms_xmlstore

    Hi,
    I'm using oracle 10g environment. In DBMS_XMLSTORE package I cannot able to insert the multiple child node value into db table.
    Here I have given the xml value
    <DATAPACKET REQUEST-ID="10001094">
      <HEADER>
        <SEARCH-RESULT-LIST>
          <SEARCH-RESULT-ITEM NAME="Ra-Al-Gul" CONFIDENCE-SCORE="750" BUREAU-ID="893991307899440">
            <IDENTIFIERS>
              <IDENTIFIER IDSOURCE="0001" MATCHED="TRUE"/>
            </IDENTIFIERS>
            <SURROGATES>
              <SURROGATE ID="CH0001" MATCHED="TRUE"/>
              <SURROGATE ID="CH0002" MATCHED="TRUE"/>
              <SURROGATE ID="CH0003" MATCHED="TRUE"/>
            </SURROGATES>
          </SEARCH-RESULT-ITEM>
        </SEARCH-RESULT-LIST>
      </HEADER>
    </DATAPACKET>for this xml data I have created the below table structure
    -- Table create script
    CREATE TABLE xml_insert (datapacket t_response );
    /* Type creation  code  */
    CREATE OR REPLACE TYPE t_response AS OBJECT
      "@REQUEST-ID" VARCHAR2(100),
      header        t_resp_header
    CREATE OR REPLACE TYPE t_resp_header AS OBJECT
      "SEARCH-RESULT-LIST"    t_search_item
    CREATE OR REPLACE TYPE t_search_item AS OBJECT
    ("SEARCH-RESULT-ITEM"      t_search_list);
    CREATE OR REPLACE TYPE t_search_list AS OBJECT
    ("@NAME"           VARCHAR2(300),
    "@CONFIDENCE-SCORE"      VARCHAR2(300),
    "@BUREAU-ID"           VARCHAR2(300),
    IDENTIFIERS           t_search_identifiers,
    SURROGATES           t_search_surrogates
    CREATE OR REPLACE TYPE t_search_identifiers AS OBJECT
    (IDENTIFIER           t_search_IDENTIFIER);
    CREATE OR REPLACE TYPE t_search_identifier AS OBJECT
      "@IDSOURCE"           VARCHAR2(20),
      "@MATCHED"           VARCHAR2(20)
    CREATE OR REPLACE TYPE t_search_surrogates AS OBJECT
    (SURROGATE           t_search_SURROGATE);
    CREATE OR REPLACE TYPE t_search_surrogate AS OBJECT
    "@ID"                VARCHAR2(20),
    "@MATCHED"           VARCHAR2(20)
    CREATE OR REPLACE TYPE tb_search_surrogate AS TABLE of t_search_SURROGATE;
    /and run this block
      DECLARE
      insCtx DBMS_XMLStore.ctxType;
      rows NUMBER;
      xmldoc CLOB :=
    <ROWSET>
    <ROW>
    <DATAPACKET REQUEST-ID="Q10001094">
      <HEADER>
        <SEARCH-RESULT-LIST>
          <SEARCH-RESULT-ITEM NAME="Anis kulam" CONFIDENCE-SCORE="750" BUREAU-ID="893991307899440">
            <IDENTIFIERS>
              <IDENTIFIER IDSOURCE="0001" MATCHED="TRUE"/>
            </IDENTIFIERS>
            <SURROGATES>
              <SURROGATE ID="CH0001" MATCHED="TRUE"/>
              <SURROGATE ID="CH0002" MATCHED="TRUE"/>
              <SURROGATE ID="CH0003" MATCHED="TRUE"/>
            </SURROGATES>
          </SEARCH-RESULT-ITEM>
        </SEARCH-RESULT-LIST>
      </HEADER>
    </DATAPACKET>
    </ROW>
    </ROWSET>';
    BEGIN
      insCtx := DBMS_XMLStore.newContext('xml_check');
      rows := DBMS_XMLStore.insertXML(insCtx, xmlDoc);
      DBMS_XMLStore.closeContext(insCtx);
    END;I got the following error
    Error Messgae :
    ORA-19031: XML element or attribute SURROGATE does not match any in type DOHADEV.T_CRB_SEARCH_SURROGATES
    ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
    ORA-06512: at line 28

    Hi,
    A couple of comments to begin with :
    - Your setup script, test case and error message are not consistent with each other.
    - You've not chosen the easiest road with DBMS_XMLSTORE and nested objects. As pointed out in a previous thread of yours, the whole thing would be far more simple with XMLTable.
    Do you really need to store the data in an object-relational structure at the end, or do you intend to further break it down into relational rows and columns?
    Do you have an XML schema?

  • Getting list of possible child nodes

    I'm trying to find an automated way to get a list of all the possible child nodes for a given element based on a schema. How does one go about doing that in Java? The closest match I could find was the class ElementEditAS, but it's deprecated with no mentioned replacement or alternative.
    Any help would be greatly appreciated.

    You are right, but what may seem simple is not.
    1) You can have combinations of choice and sequence constructs in the contents.
    2) The element definitions are just references to true definitions somewhere else.
    3) You can include other schema files, so you need to work with an arbitrary number of files at the same time.
    Basically, all you have to do is read one or more schema files as XML files, probably using DOM or JDOM or whatever you know. Avoid SAX, since you need the full tree structure of the schema file.
    Having done something similar, be aware that element names are described in attributes of the element tag, and attributes are defined as elements. Be ready to redo your code a time or two because the names you use (attribute and element) are not working as you expected.
    Dave Patterson

  • Problem while handling Parent and child nodes in CE

    Hi all
    I am facing a problem with handling Child and Parent nodes in CE.
    I have a Table in which I have drop downs. On selecting a value in the drop down, I have to take that value and do some action.
    I am trying to access the value in the following ways
    wdContext.nodeParent().currentParentElement().nodeChild().currentChildElement().getVaActivity();
    wdContext.nodeChild ().currentChildElement().getVaActivity();
    When I select the drop down from the first row of the Table the code works fine.
    But when I select other rows, it returns the current value of the first row.
    The lead selection of the parent always returns u20180u2019 even though you have done some action in row 2,3 etc.
    The same code gives the required values in EP 7.0; I.e.: it returns the values form selected row in the table.
    Basic problem is that the current value of parent always returns the first row.
    Following are the Properties of the nodes
    Parent
    Collection Cardinality: 0-n
    Singletone: true
    Child:
    Collection Cardinality: 0-n
    Singletone: false
    Please help
    Regards
    Deepu

    Hi,
       In CE changing dropdown selections doesn't fire table leadselection events. If you want to use a dropdown in a context-driven UI element like a Table, you need to use of event parameter mappings. So here are the steps:
    1. Create a new action for the onSelect event of the dropdown (I will write the code for DropDownByIndex), let's call it Select.
    2. Add a parameter parentElement whose type is same as the type of the parent node element. So from your example it would be IParentElement. Select the chek-box for "Adapt event-handler parameter". This will add a new parameter to the event-handler method onActionSelect called parentElement.
    3. Write this inside wdDoModifyView :
    if (firstTime) {
        IWDAbstractDropDownByIndex ddi = (IWDAbstractDropDownByIndex) view.getElement("<id of DropDownByIndex>");
        ddi.mappingOfOnSelect().addSourceMapping(IWDAbstractDropDownByIndex.IWDOnSelect.NODE_ELEMENT,"parentElement");
    3. If you want to set the lead selection of the table to the row where the dropdown is write this inside the event-handler:
    wdContext.nodeParent().setLeadSelection(parentElement.index()); //parentElement is the event handler parameter added through the action.
    Note that the event parameter IWDOnSelect.NODE_ELEMENT points to the node element that defines the data mapping for the containing row and not the node element of the source for the dropdown. This has been specfically  added for such a scenario. All this is well documented [here|http://help.sap.com/javadocs/nwce/current/wdr/com/sap/tc/webdynpro/clientserver/uielib/standard/api/IWDAbstractDropDownByIndex.IWDOnSelect.html#NODE_ELEMENT].
    Regards,
    Satyajit.

  • Dynamic creation of ItemListBox and binding a child node

    Hello @all,
    I have the following context structure
    root
    --category
    -- --report
    -- -- --id
    -- -- --name
    -- --id
    -- --name
    the parent node is "category" with attributes "id" and "name" and the child node is "report" with "id" and "name".
    Now I want on an onAction-Event of a Button, that for every category an itemListBox will be created with the according report names. the creation of the itemList is not the problem, but the binding of the datasource and/or the descriptivetext.
    my code:
    public void initItemListBox( )
        //@@begin initItemListBox()
        IWDView view = wdContext.currentContextElement().getSelectView();
        IWDGroup group = (IWDGroup) view.getElement("ItemListGroup");
        if (group.hasChildren())
          group.removeAllChildren();
        for (int i = 0; i < wdContext.nodeCategory().size(); i++)
          ICategoryElement catEl = wdContext.nodeCategory().getCategoryElementAt(i);
          wdContext.nodeCategory().setLeadSelection(i);
          generateItemLists(wdContext.currentContextElement().getSelectView(), wdContext, catEl);
        //@@end
    public void generateItemLists( com.sap.tc.webdynpro.progmodel.api.IWDView view, de.mgi.portaldev.bc.mdw.msi.wdp.IPrivateCRSReportView.IContextNode wdContext, de.mgi.portaldev.bc.mdw.msi.wdp.IPrivateCRSReportView.ICategoryElement category )
        //@@begin generateItemLists()
        //    ItemListBox
        IWDGroup group;
        IWDGroup catGroup;
        IWDLabel label;
        String groupId = "group_" + category.getName();
        catGroup = (IWDGroup) view.createElement(IWDGroup.class, groupId);
        IWDMatrixLayout matrLayout = (IWDMatrixLayout) catGroup.createLayout(IWDMatrixLayout.class);
        String labelId = "label_" + category.getName();
        label = (IWDLabel) view.createElement(IWDLabel.class, labelId);
        label.setText(category.getName());
        IWDMatrixData layout = (IWDMatrixData) label.createLayoutData(IWDMatrixData.class);
        layout.setVAlign(WDCellVAlign.TOP);
        String itemListId = "itemList_" + category.getName();
        IWDItemListBox itemListBox = (IWDItemListBox) view.createElement(IWDItemListBox.class, itemListId);
        label.setLabelFor(itemListId);
        IWDMatrixData itemlayout = (IWDMatrixData) itemListBox.createLayoutData(IWDMatrixData.class);
        itemListBox.bindDescriptiveText("crsReporting.category.report.name");
        IWDNodeInfo reportNodeInfo = category.nodeReport().getNodeInfo();
    //    itemListBox.bindText(reportNodeInfo.getAttribute("name"));
        itemListBox.setVisibleItems(5);
        IWDMatrixHeadData matrixHead = (IWDMatrixHeadData) itemListBox.createLayoutData(IWDMatrixHeadData.class);
        IWDAction itemListAct = (IWDAction) wdThis.wdGetItemSelectAction();
        itemListBox.setOnLeadSelect(itemListAct);
    //    itemListBox.bindDataSource(reportNodeInfo);
        itemListBox.bindDataSource("crsReporting.category.report");
        catGroup.addChild(label);
        catGroup.addChild(itemListBox);
        group = (IWDGroup) view.getElement("ItemListGroup");
        group.addChild(catGroup);
        //    END ITEMLIST
        //@@end
    What am I doing wrong? in every ItemListbox there are only the report names of the last category.
    thanks.

    RowRepeater is available in WD Java since NW CE (7.1). With RowRepeater, the solution is trivial and can be done completely by declaration in view designer.
    In earlier releases, you can solve it as follows (non-trivial)
    - For each category, create a separate context node "Category_i" with an attribute "name"
    - Inside each category node, create a non-singleton node "Reports" with an attribute "name"
    - Foreach report, add a node element to the reports subnode of its category node <b>element</b>
    All this has to be done using the generic context API.
    On each change of the data, reset the context and re-create these nodes.
    In wdDoModifyView(), check if data have changes and create UI elements programmatically.
    - For each category, create a group, bind header text to category name.
    - Inside each group, create a ItemListBox, bind "dataSource" to reports sub-node of category (non-singleton!) and bind "text" to text attribute of report node.
    Sample code:
    To build context structure:
    private void createCategories()
        for (int i = 0; i < 3; ++i)
          IWDNodeInfo categoryNodeInfo = wdContext.getNodeInfo().addChild("Category" + i, null, true, CMICardinality.ONE, CMICardinality.ONE, true, null);
          IWDAttributeInfo att = categoryNodeInfo.addAttribute("name", "ddic:com.sap.dictionary.string");
          IWDNode categoryNode = wdContext.getChildNode(categoryNodeInfo.getName(), 0);
          categoryNode.getElementAt(0).setAttributeValue(att.getName(), "Category #" + i);
          IWDNodeInfo reportNodeInfo = categoryNodeInfo.addChild("Reports", null, false, CMICardinality.MANY, CMICardinality.ZERO_TO_ONE, true, null);
          IWDAttributeInfo attReportName = reportNodeInfo.addAttribute("name", "ddic:com.sap.dictionary.string");
          IWDNode reportNode = categoryNode.getChildNode("Reports", 0);
          for (int j = 0; j < 5; ++j)
            IWDNodeElement report = reportNode.createAndAddElement();
            report.setAttributeValue("name", "Report #" + j);
    To recreate UI:
    if (<data_have_changed>)
          IWDTransparentContainer root = (IWDTransparentContainer) view.getRootElement();
          for (int i = 0; i < 3; ++i)
            IWDNode categoryNode = wdContext.getChildNode("Category" + i, 0);
            IWDAttributeInfo attName = categoryNode.getNodeInfo().getAttribute("name");
            IWDGroup group = view.createElement(IWDGroup.class);
            root.addChild(group);
            IWDCaption header = view.createElement(IWDCaption.class);
            group.setHeader(header);
            header.bindText(attName);
            IWDNode reportsNode = categoryNode.getChildNode("Reports", 0);
            IWDAttributeInfo attReportName = reportsNode.getNodeInfo().getAttribute("name");
            IWDItemListBox list = view.createElement(IWDItemListBox.class);
            group.addChild(list);
            list.bindDataSource(reportsNode.getNodeInfo());
            list.bindText(attReportName);
    Armin
    Fixed code tags

  • Storing  data in a  child  node

    Hi All,
    I have a parent node called "tablemain" and child node for it is "tablechild" .
    This "tablechild" has a attribute called "id" .
    I have a input field and "save" button in my output screen.
    If I enter value in inputfield and press save button the value should be stored as 1st element in the node ""tablechild" .
    After clering the value in inputfield and if I again enter a new value in that and press save button the value should be stored as a second element in the "tablechild" .The process should be continued like this.
    How can I do achieve this?Please help me in this.
    Thanks in advance.
    Message was edited by:
            Bharath Akuthota

    Hi Bharath,
    Follow this code in your button click:
    // Get the id from the input filed
    String id = wdContext.currentContextElement().get<input filed att>();
    IPrivateTableComponentView.I<TAblemain>element ele1 = wdContext.create<TAblemain>element();
    wdContext.node<TAblemain>().addElement(ele1);
    IPrivateTableComponentView.I<TAblechild>element ele = wdContext.node<TAblemain>.node<TAblechild>.createVn_ChildElement();
    ele.set<table child att>(id);
    wdContext.node<TAblemain>.node<TAblechild>.addElement(ele);
    Then print the size of the node and see whne u add the attributes.
    wdComponentAPI.getMessageManager().reportSuccess("Size of child node "+wdcontext.node<TableChild>().size());
    This will solve ur problem,
    Regards,
    Nagarajan.

  • Child nodes as document object

    I have a xml document as follows:
    <Root>
    <Header><Name></Name></Header>
    <Message><Type></Type></Message>
    </Root>
    I can read entire xml file into document object. Now I want to take only <Message> elements (Including Message child nodes) into document object, How can I do that.

    There's a usable xml parser API in Java core library.

  • Xpath: get attributes from first child node

    Hi,
    I have some problems by getting the attributes from the first child node, if i try to get child elements everything works fine, but whenever i need the elementvalue from a node with attributes i doesn't return anything.
    The xpath expression works fine if i want to get the element value from all childs, but not when i just want from one of them.
    This one works,
    XPathFactory factory1 = XPathFactory.newInstance();
        XPath xpath = factory1.newXPath();
        xpath.setNamespaceContext(new PersonalNamespaceContext());
        XPathExpression expr
         = xpath.compile("//default:DeviceExchange[1]/default:Status/text()");
       // gets the value of the node picked out
        Object result = expr.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes = (NodeList) result;
        for (int i = 0; i < nodes.getLength(); i++) {
          names[i] = nodes.item(i).getNodeValue();
          String a = names;
    // checks if status is exchanged, if it is sets status to 1
    if (a.length() == 9){
    names[i] = "1"; }
    else{  names[i] = "0";}
    System.out.println(names[i]);This doesn'tXPathFactory factory2 = XPathFactory.newInstance();
    XPath xpath2 = factory2.newXPath();
    xpath2.setNamespaceContext(new PersonalNamespaceContext());
    XPathExpression expr2 = xpath2.compile("//default:DeviceExchange[1]/default:Field[@names='MLPKTID']/text()");
    Object result2 = expr2.evaluate(doc, XPathConstants.NODESET);
    NodeList nodes2 = (NodeList) result2;
    for (int i = 0; i < nodes2.getLength(); i++) {
    names2[i] = nodes2.item(i).getNodeValue();
    System.out.println(names2[i]);}Does anyone have any ideas? I will apreciate all help!
    Edited by: fusen on Oct 25, 2007 1:12 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Sorry, solved myself. Just � typo that that i couldn't detect.

  • NodeList.item(i) returns every other child node

    I have used the following code to eliminate null elements from a Node.
    But somehow NodeList.item(i) only returns every other child node.
    The original Node (retNode) is:
    <getHearingDetailsByCaseNoWSResponse><hearingDetailsVO xmlns="http://vo.cis.com"><NOA/><applicationNo>sAppNo0</applicationNo><caseNo/><designation/><docID/><duration/><endTime/><hearDate/><judgeName/><natureOfClaim/><outCome/><outComeTime/><outcomeDate/><remarks/><roomNo/><sessionNo/><stEndTime/><tohCode/><typeHear/></hearingDetailsVO></getHearingDetailsByCaseNoWSResponse>
    retNode.getLength() gives 19 which is correct.
    NodeList lv2List = retNode.getChildNodes();          
    int numOfLv2 = lv2List.getLength();
    if(numOfLv2 == 0) {
         if(!hasAttribute(node)) parent.removeChild(node);
              return;
         for(int i=0; i<numOfLv2; i++) {
              Node lv2Node = lv2List.item(i);
              if(lv2Node == null || lv2Node.getNodeType() != Node.ELEMENT_NODE) continue;
              removeNullElement(lv2Node);     
         }However, lv2List.item(0) returns <NOA/> element, lv2List.item(0) returns <caseNo/>, lv2List.item(1) returns <docID/>, and lv2List.item(9) returns <typeHear/>. From item(10) to item(18) all returns null.
    I was very confused by this.
    I am using Xerces-J implementation. I have set
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
    Did I do something wrong or I missed out something?
    Please enlighten me.
    Regards,
    Xinjun

    When an element is removed from a list, the index of each element coming after the removed one will be one less than it was before the removal, so you will have to subtract 1from the variable "i" after you have removed an element and before you start the next cycle in order not to skip the index of the removed element:for(int i=0; i<numOfLv2; i++) {
      Node lv2Node = lv2List.item(i);
      if(lv2Node == null || lv2Node.getNodeType() != Node.ELEMENT_NODE) continue;
      removeNullElement(lv2Node);
      i--
    }

  • Iterating the Child Nodes

    Hi Everybody,
    I have the following Context:
    ParentNode
           - ChildNode1
                        -Visible
           - ChildNode2
                        -Visisble
           -ChildNode3
                        -Visible
    Similalry, I have 10 Child Nodes. Now I want to access the attribute "Visible" under each Child Node by iterating it. How to do that...?
    My Scenario is, I am having 10 Tabs and Each Tab has 20 Tables, these UI elements are designed as static.
    Now from R/3 I will receive No.Of tabs to be visible, for Example if TabVisible value is 5, then Only 5 tabas are visible out of 10. Then I will receive No. of Tables to be displayed in Each Tab, for example, in Tab1 - 8 ables; Tab2 - 5 Tables; Tab3-6 Tables.  I have set the Visible Contest binded to each UI element. Now I wan to loop it to get the output structure.
    So, I hae designed the Context structure as follows:
    <b>Tab1</b> <b>(Parent Node)</b>
          - <i>Table_1</i>        <b> (Child Node)</b>
                  - Visible         <b>(Attributes)</b>
                  - ColHeader
          - <i>Table1_!</i>
                   -Visible
                   - ColHeader
          - <i>Table2_1</i>
                   -Visible
    -Tab1Visble <b>(Parent Node Attribute)</b>
    <b>Tab2</b>
           - <i>Table_2</i>
                  - Visible
    It goes on like this...
    Please give me solution for the above case...if possible code snippets..
    Thanks in advance
    Regards/Guru

    Hi Kumara,
    According to your specified requirement you have 10 Tabs and each Tab contains 20 Tables. So to control the visibility you first need to assign the Visibility Property of each individual tab/ table  to different value nodes of type com.sap.ide.webdynpro.uielementdefinitions.Visibility. To control the visibility of the tables and tabs you can follow the context structure like this.
    Tab1 ( Parent Value Node )
    |....Visible  ( Value attribute for Tab Visiblity )
    |..........Table1 ( Child Value Node under Parent Node )
               |......Visible ( Value attribute for table Visiblity )
    |..........Table2
               |......Visible
    |..........Table3
               |......Visible
    |..........Table4
               |......Visible
    Once you assign the visible property of all your UI elements like (Tables, Tabs) you can very easiliy control the visibility of each individual Tab like Tab1 with the
    following code.
    wdContext.currentTab1Element().setVisible(WDVisibility.NONE);
    and to control the visibility of each table under each Tab for example ( Table1 under Tab1 ) use this following code.
    wdContext.createTable1Element().setVisible(WDVisibility.NONE);
    I have tried my level best to help you.
    Thanks and Regards
    Avijit

Maybe you are looking for

  • Can I create a task in Outlook 2010 from a .pdf

    Hello New here. Using Adobe Acrobat Standard X Windows 7 Prof 32 bit Outlook 2010 I can create an Outlook 2010 task from a word doc or excel spreadsheet, now I would also like to be able to create such a task from a .pdf Example: I'm corresponding wi

  • Files stored in wrong place...

    Media files should be stored on my F: drive as I specified in advanced settings. My ebooks are stored there correctly. But apps, album art, and .itl/.xml file are in My Documents taking up too much space on my root drive. No I see that external drive

  • Oracle Forms Sizing

    Hi gurus. Somebody have a sizing tool for an Oracle Forms Application? I need to prepare a server to run an Oracle Forms Application. I have almost 700 users that will use this Oracle Forms Application. Somebody have any idea or some suggestion? Than

  • Need Permission for Firefox Update?!

    More permissions problems in Leopard. I've been trying to install the latest version of Firefox (2.0.1.14 or something to that effect) only to have it tell me at start-up that the update can't be installed because I do not have sufficient permission

  • When starting webcenter domain, how not to enter userid and password?

    Dear All, I followed this link http://yonaweb.be/start_webcenter_domain in installing my webcenter domain and I was successful in setting my own webcenter and busy exploring the webcenter spaces. My only concern is that when I am starting my webcente