Node addElement or ChangeElement....

Hello ,
I have a senario that user enters some values and later if he wishes he can change the values he entred last time....
So right now I have doing something like:
wdContext.nodeAddress_Tmp().addElement(wdContext.currentContextElement().getRowNr(), newAddress_tmp);
in newAddress_tmp is the data which he entered first time or then change.... I am storing the user data in node at the row level..... so e.g at row 1 I entered the data, and 2nd time again at row1 I want to update the data.... , my question is instead of addElement, how I can update or modify at the same index ?
Pls suggest...if that is possible....
Regards,

I try to explain the issue again,
I have a table with some columns and among them a dropdown and button.
where for a particular row user can enter some address in one popup ( when user selects somthing from dropdown a popup will appers to take his values ). Once entered the address, he can later show/edit the data for that particular row ( while clicking on the button ) . Showing this address data working fine, my problem is  EDIT:
when user after first entering the addrress details wished to change he click on button in table
I read the row nr and display him the data which he enters first time...... as I have stored the data against the row like this:  node.addElement(rownr, data )
now he change the data on popup and click again submit, ( here starts my problem , that how I store this data in my node )
before I used node.addElemtn(rownr, data ) now if I use again node.addElement(rownr, data ) then I have for same row two entries, .....where as I want to rewrite the data for the same row.....
Edited by: Shah H on Aug 4, 2008 5:52 PM
Edited by: Shah H on Aug 4, 2008 8:12 PM

Similar Messages

  • How to create a new Node and bind it to the wdContext root at run time

    Hi experts,
    Does anyone have sample code about 1) adding a new node to the root context, 2) give it a name and 3) referring to this newly created node with the conetxt path?
    Thanks

    Armin,
    I am trying to do this and keep getting erro about incompatible class:
    wdContext.getNodeInfo().addChild("DynamicNode",
                  mymodel.class,
                  true,
                  CMICardinality.ONE,
                  CMICardinality.ZERO_TO_ONE,
                  true,
                  wdContext.getContext().getStructure("com.my.structure") );
                  IWDNode node = wdContext.getChildNode("DynamicNode", 0);
                  IWDNodeElement e = node.createElement(an_instance_of mymodelObject());
                  node.addElement(e);
    Can I do it this way?

  • Trying to add a node in a TreeByNestingTableColumn

    Hello All,
    I'm still having problems doing this!
    I followed the tutorial step by step on how to Integrate a Tree structure in Web Dynpro table.
    I'm using NWDS 7.0.18 on EP 7.0
    The tutorial can be found [here|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/de59f7c2-0401-0010-f08d-8659cef543ce]
    I changed mine around a little bit to use Levels.java instead of Catalog.java.
    I got it working fine. Now the next step I want to do is add a toolbar button that will add a node in the tree structure. So I created the relevant button with an action onActionInsertNode and its signature its the same as the signature for Loading children nodes
    public void onActionInsertNode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent,
    com.sjm.wdp.wdp.IPrivateTreeAppCompView.ILEVELElement element )
        //@@begin onActionInsertNode(ServerEvent)
        addNewLevel(element.nodeCHILD_LEVEL(), element.getID()); // Null pointer exception here
        //@@end
    I created a new method called addNewLevel to add a single element which is the new node. It looks like this
    public void addNewLevel( com.sjm.wdp.wdp.IPrivateTreeAppCompView.ILEVELNode node,
    java.lang.String parentId )
        //@@begin addNewLevel()
         IPrivateTreeAppCompView.ILEVELElement newLevelElement;
         if(parentId.equals(Levels.getParentId(node.LEAD_SELECTION)))
              newLevelElement = wdContext.nodeLEVEL().createLEVELElement();
              node.addElement(newLevelElement);
        //@@end
    Now when I click the Insert Node button, I want to insert a new node underneath the selected node, ie I want to make it the child of the selected node. node.LEAD_SELECTION. If I look at my code it seems as if I'm following the same logic as the code provided by the tutorial, except the tutorial loops thru the multidimensional array in the Java file and I'm just trying to add a single child node.
    I get a null pointer exception when the onActionInsertNode fires, Ive indicated above where.
    Can someone kindly please explain what I am doing wrong?
    Thanks in advance.
    PS. I forgot to mention that when I created my action onActionInsertNode, I did NOT check the without validation checkbox. I don't actually know what this checkbox does, but in the tutorial is asks you to check this box when you create onActionLoadChildren.

    Hi Armin,
    So using what you have given me so far here is how the getTreeSelection().index() is returning
    context                      getTreeSelection().index()
    -Root                                       -1   
      - child1                                   0
        - gchild1_1                            0
          - leaf1_1                             0
          - leaf1_2                             1
        - gchild1_2                            1
        - gchild1_3                            2
      - child2                                   1
        - gchild2_1                            0
        - gchild2_2                            1
    Here is my code to add a node into the desired position in the tree.
    public void onActionInsertNode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent,
    com.sjm.wdp.wdp.IPrivateTreeAppCompView.ILEVELElement element )
        //@@begin onActionInsertNode(ServerEvent)
        //addNewLevel(element.nodeCHILD_LEVEL(), element.getID());
        if(wdContext.nodeLEVEL().getLeadSelection() != IWDNode.NO_SELECTION)
             try
              IPrivateTreeAppCompView.ILEVELElement newChildElem =
                                                     wdContext.createLEVELElement();
              wdContext.nodeLEVEL().addElement
                                   (wdContext.nodeLEVEL().getTreeSelection().index(), newChildElem);
         catch(Exception e)
        //@@end
    However, despite specifying where to add the node, the node keeps getting created and added at the root level. Please help out.
    Marshall.

  • How to instantitate a non-singleton node

    I need to instantitate the non-singleton node which has the following properties
    Collection cardinallity of 0..n
    and
    Selection Cardinallity of 0..1
    But when I try to get this node using wdContext.nodeA().nodeB()
    where
    nodeA is singleton
    nodeB is non-singleton whose properties are given below
    I always get nodeB as null . it seems nodes are initialized only if set to singleton
    I need non-singleton node for using the TableRowGrouping element
    If any one can please help that will be great

    Hi Gaurav,
    You have not mentioned nodeA  properties.If it's cardinality is 1..x then no need to initialize A otherwise you must initialize A first then initialize nodeB.
    Try like this:
    //If  cardinality of A is not 1...1
    IPrivateTrstView.IAElement ele = wdContext.createAElement();
    //Set if there are any attributes
    ele.setXXX();
    wdContext.nodeA().addElement(ele);
    IPrivateTrstView.IBElement ele = wdContext.createBElement();
      ele.setXXX();
    wdContext.nodeB().addElement(ele);
    The singleton property refers the relationship between the node and its parent but not between the node its child as for as I know.
    Regards,
    Siva

  • Dynamic node Creation Problem

    Hi all,
    I am trying to create a node through Java code bellow is the code
    IWDNodeInfo graph = wdContext.nodeGraph().getNodeInfo();
    for(int i=0;i<10;i++)
         int nodeNumber = i+4;
         IWDNodeInfo seriseNode = graph.addChild("Serise"+nodeNumber,null,true,false,false,false,false,false,null,null,null);
         seriseNode.addAttribute("S"+nodeNumber+"_size","com.sap.dictionary.double");
         seriseNode.addAttribute("S"+nodeNumber+"_xVal","com.sap.dictionary.double");
         seriseNode.addAttribute("S"+nodeNumber+"_yVal","com.sap.dictionary.double");
         //seriseNode.addAttribute("S"+nodeNumber+"_tooltip","com.sap.dictionary.string");
         IWDNode node = wdContext.nodeGraph().getChildNode("Serise"+nodeNumber,IWDNode.NO_SELECTION);
         IWDNodeElement nodeElem = node.createElement();
         nodeElem.setAttributeValue("S"+nodeNumber+"_xVal",new Double(0));
         nodeElem.setAttributeValue("S"+nodeNumber+"_yVal",new Double(0));
         nodeElem.setAttributeValue("S"+nodeNumber+"_size",new Double(0));
         node.addElement(nodeElem);
    IWDNode node = wdContext.nodeGraph().getChildNode("Serise4",IWDNode.NO_SELECTION);
    node.getCurrentElement().getAttributeAsText("S4_size");
    now it is giving me null pointer exception at last line any idea why it coming.
    Thanks

    Hi,
    This problem is solved but now there is another problem,
    I am creating a Node and attributes at runtime and want to bind to a business graphics UI element bellow is the code for that
    IWDPoint se_point = (IWDPoint) view.createElement(IWDPoint.class,"Series"+seriseNumber+"_Point");
    se.setPoint(se_point);
    se.getPoint().bindValueSource("Graph.Serise"+seriseNumber);
    se.setLabel(supp.getSupplier_Name());
    IWDNumericValue numXVal = (IWDNumericValue) view.createElement(IWDNumericValue.class,"S_"+seriseNumber+"numXVal");
    numXVal.bindValue("Graph.Series"+seriseNumber+".S"+seriseNumber+"_xVal");
    numXVal.setType(WDValueTypeEnumeration.X);
    numXVal.setValue(supp.getXcord());
    and it gives bellow error for last line in the code
    com.sap.tc.webdynpro.progmodel.context.ContextException: Node(GraphView.Graph): no child node 'Series1' at index -1
    Can any one help in this
    Thanks

  • Delete node elements

    I have created 5 elements of a node . I want to delete nodes. But it is giving error .
    Context
              sample (node )    [ cardinality 0...n , selection 0..1 ]
                          name (attr)
                          number(attr)
    code :
    public void onActioncreate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActioncreate(ServerEvent)
        for(int i=0;i<5;i++){
             IPrivateClearnodeElements.ISampleNode node =wdContext.nodeSample();
             IPrivateClearnodeElements.ISampleElement ele = node.createSampleElement();
             ele.setName("Name "+i +" : " );
             ele.setNumber(i+"");
             node.addElement(ele);
        //@@end
      public void onActionclear(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionclear(ServerEvent)
        wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeSample().size()+"");
        for(int i=0;i<5;i++)
              try{
              wdContext.nodeSample().removeElement(wdContext.nodeSample().getSampleElementAt(i));
              wdComponentAPI.getMessageManager().reportSuccess("Deleted : "+ i+"");
              catch(Exception e)
                   wdComponentAPI.getMessageManager().reportSuccess(e.getMessage()" : " i+"");
        //@@end
    output :
    5
    Deleted : 0
    Deleted : 1
    Deleted : 2
    Index: 3, Size: 2 : 3
    Index: 4, Size: 2 : 4
    Why it is not able to delete the last two node elements ????????????????//
    Also any other way is there to  delete  elements of the node?
    Srini

    Hi srinivasa,
    You have used the code to delete the element
    for(int i=0;i<5;i++)
    try{
    wdContext.nodeSample().removeElement(wdContext.nodeSample().getSampleElementAt(i));
    wdComponentAPI.getMessageManager().reportSuccess("Deleted : "+ i+"");
    catch(Exception e)
    wdComponentAPI.getMessageManager().reportSuccess(e.getMessage()" : " i+"");
    Now.. See getSampleElementAt(i) method returns the element of i th element. On that case you have to use
    getSampleElementAt(0). In that case it wiil return 0ih element end 0th element will be deleted. After deletion the 0th element 1st element will move to the 0th position.
    So. in that way you can delete all the elements.

  • Creating nodes straight under context dynamically

    Hi,
    I need to build a dynamic amount of tables dynamically. They all have the same buildup (same columns) but their data is different. I wanted to solve this by creating nodes under the context dynamically and manually binding them to created tables....the only problem is I can't find a way to create a node dynamically.....
    Found some links to a weblog but its seems out of sync...
    can anyone help me out here?
    Much thanks & regards,
    Hugo

    Hi
    Code for creating a node dynamically and code for creating the table dynamically and binded it dymaically created value node
    public void wdDoInit()
        //@@begin wdDoInit()
         // creation of value Node for table dynamically
         IWDNodeInfo nodeinfo=wdContext.getNodeInfo().addChild("tablenode",null,true,true,true,false,true,true,null,null,null);
         nodeinfo.addAttribute("tableattr1","ddic:com.sap.dictionary.string");
         nodeinfo.addAttribute("tableattr2","ddic:com.sap.dictionary.string");
         nodeinfo.addAttribute("tableattr3","ddic:com.sap.dictionary.string");
         //Code for removing the intial element in the table node
         IWDNode node=wdContext.getChildNode("tablenode",0);
         IWDNodeElement ne=node.getElementAt(0);
         node.removeElement(ne);
    // filling the data for table node
         Object obj1=..;   //  Data for table convert to object type
         Object obj2=..;
         Object obj3=..;
         //creating elements for tablenode and displaying it
         IWDNode node=wdContext.getChildNode("tablenode",0);
         IWDNodeElement ne1=node.createElement();
         ne1.setAttributeValue("tableattr1",obj1);
         ne1.setAttributeValue("tableattr2",obj2);
         ne1.setAttributeValue("tableattr3",obj3);
         node.addElement(ne1);
        //@@end
    public static void wdDoModifyView(IPrivateDynamicProgrammingView wdThis, IPrivateDynamicProgrammingView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
         if(firstTime){
            IWDTransparentContainer con=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
                //creation of table
            IWDTable table =(IWDTable)view.createElement(IWDTable.class,"table1");
            table.bindDataSource("tablenode");
            IWDTableColumn tablecolumn1=(IWDTableColumn)view.createElement(IWDTableColumn.class,"tablecolumn1");
            IWDTextView tabletextview1=(IWDTextView)view.createElement(IWDTextView.class,"ttv1");
            tabletextview1.bindText("tablenode.tableattr1");
            IWDTableCellEditor editor1=tabletextview1;
           tablecolumn1.setTableCellEditor(editor1);
           IWDCaption cap1=(IWDCaption)view.createElement(IWDCaption.class,"cap1");
           cap1.setText("Name");
           tablecolumn1.setHeader(cap1);
            table.addColumn(tablecolumn1);
            IWDTableColumn tablecolumn2=(IWDTableColumn)view.createElement(IWDTableColumn.class,"tablecolumn2");
                    IWDTextView tabletextview2=(IWDTextView)view.createElement(IWDTextView.class,"ttv2");
                    tabletextview2.bindText("tablenode.tableattr2");
                    IWDTableCellEditor editor2=tabletextview2;
                   tablecolumn2.setTableCellEditor(editor2);
                    table.addColumn(tablecolumn2);
              IWDTableColumn tablecolumn3=(IWDTableColumn)view.createElement(IWDTableColumn.class,"tablecolumn3");
                     IWDTextView tabletextview3=(IWDTextView)view.createElement(IWDTextView.class,"ttv3");
                     tabletextview3.bindText("tablenode.tableattr3");
                     IWDTableCellEditor editor3=tabletextview3;
                    tablecolumn3.setTableCellEditor(editor3);
                     table.addColumn(tablecolumn3);
                 con.addChild(table);
        //@@end
    Thanks and Regards,
    Arun Srinivasan

  • Value not getting resetted for Node inside Node

    Hi All
    I have created the node structure as below
    A (Value Node)
    |_ID (value attribute)
    |_B (Value Node)
        |__Val (Value Attribute for Node B)
    Now the code is as follows
    for(i = 0 ; i < n ; i++ ){
    Ele Aele = createElement
    Aele.setID("1")    
    nodeA.addElement(Aele)
    for(j = 0 ; j < n ; j++ ){
        Ele Bele = createElement
         Bele.setVal("Val1")
         nodeB.addElement(Bele)
    Now i want for ID - 1 , Val - a,b,c
    when sec time loop iterates
    ID - 2 , Val - d,e,f
    But the problem is that
    For ID - 1 , i am getting Val - a,b,c,d,e,f
    when sec time loop iterates
    ID - 2 , Val - a,b,c,d,e,f
    I hope you all can get what my problem is..
    Kindly comment and help me out
    Regards
    Sonal Mangla
    Message was edited by:
            Sonal Mangla

    Hi ,
    There are a lot similar posts in forum.
    You can also search help.sap.
    Try this link. They have explained creation of similar context structure.
    http://help.sap.com/saphelp_nw04/helpdata/en/13/4cde139306304480e89d815ffcf891/frameset.htm
    Regards
    Bharathwaj

  • How to expand all the nodes in a tree while loading the tree initially

    Hi All
    Now i am able to display the tree strucute in webdynpro.
    but it is displaying the tree initially in collapsed mode until/unless we click on the node root it will be expanded.
    but my requirement is i wanted to display the tree in expanded mode by default at runtime initially.
    can you please provide any setting to be done or any sample code on the same then it would be great help to me.??
    Thanks
    Trisha

    Hi,
    isLeaf is an attribute you need to create under "CatalogEntries" node. And "isRoot" is not requried.
    Download the sample project "TutWD_TreeByNestingTableColumn". See the below link to dnld this project.
    https://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/503f22f6-b978-2a10-bf97-ddc21267e752 [original link is broken]
    Do the changes in sample project as below:
    Invoke this method in the init method as below (as it is in the same project).
    addCatalogEntries(wdContext.nodeCatalogEntries(), "ROOT");
    Change the code in addCatalogEntries() method as below.
    Here we are calling the addCatalogEntries() method recursively for all the parent elements and we are changing the  setExpanded property to true.
    public void addCatalogEntries( com.sap.tut.wd.treetable.wdp.IPrivateTreeTableView.ICatalogEntriesNode node, java.lang.String parentId )
    //@@begin addCatalogEntries()
    IPrivateTreeTableView.ICatalogEntriesElement newCatalogEntriesElement;
    for (int i = 0; i < Catalog.getLength(); i++) {
    if (parentId.equals(Catalog.getParentId(i))) {
    // create new context node element
    newCatalogEntriesElement = node.createCatalogEntriesElement();
    node.addElement(newCatalogEntriesElement);
    // provide node elements with data
    newCatalogEntriesElement.setID(Catalog.getCATALOGID(i));
    newCatalogEntriesElement.setTITLE(Catalog.getTITLE(i));
    newCatalogEntriesElement.setDESCRIPTION(Catalog.getDESCRIPTION(i));
    newCatalogEntriesElement.setAMOUNT(Catalog.getAMOUNT(i));
    if ("ARTICLE".equals(Catalog.getCATALOGTYPE(i))) {
    // checkbox is visible by default
    newCatalogEntriesElement.setPUBLISHED(Catalog.getPUBLISHED(i));
    // third level is last level
    newCatalogEntriesElement.setIsLeaf(true);
    } else {
    // a CATEGORY does not use the checkbox column
    newCatalogEntriesElement.setUsageOfPublishedAttribute(WDVisibility.BLANK);
    newCatalogEntriesElement.setIsLeaf(false);
    newCatalogEntriesElement.setChildrenLoaded(true);
    newCatalogEntriesElement.setExpanded(true);
    addCatalogEntries(newCatalogEntriesElement.nodeChildCatalogEntries(),newCatalogEntriesElement.getID());

  • WD Tut18: when to bind and when to addElement() ???

    Hi All,
      I am trying <b>Context Programming and Data Binding (18) tutorial</b>.
      I am slight confused.. when to bind() and when to addElement()'s:
    page 22>>
    newCustomerNodeElement.nodeAddress().bind(newAddressNodeElement);
    page 26>>
    node.addElement(newOrderNodeElement);
    page23 explanation >>
    Note that, if you call the method bind (newCustomerNodeElement) instead of addElement(newCustomerNodeElement), only the last bound node element of the type Customer is contained in the list of node elements. That is, wdContext.nodeCustomers().bind(newCustomerNodeElement) overwrites the list of node elements of the type Customer.
      Is it that .. when the cardinality is 0..1 (or) 1..1>> we have to <b>bind</b> elements and when cardinality 0..n (or) 1..n >> we have to <b>addElement();</b> ??
      Also i didn't get the exact advantage of a supplyFunction.
    Can any1 help me out ?? explain me .. more detailedly ???
    Thank u very much in advance,
    kanth.

    Beginner,
    In general, bind and addElement are interchangeable: you may either bind or addElement.
    For example, if cardinality is 0..1 you may add sole element or bind this element. If the cardinality is 0..n then you may either bind collection of elements or add elements one by one.
    Typically, bind is used when you populate node content initially, addElement is used when user adds/removes already populated node.
    VS

  • Approach Context node in code

    Dear forumpeople,
    At this moment I try to set an attribute with this code:
    wdContext.currentContextElement().set...
    But, how should I set an attribute which is set in a node?
    We tried:
    wdContext.current***Element().set*("");
    But this is not working because of a NullPointerException.
    Any ideas?
    Regards,
    Adri

    Adi,
    That code applicable for context attubutes not for context Node Attributes.
    Follow this code,
      Adding Values to Context Node:
    <b><i>Syntax:</i></b>
    IPrivate<View Name>View.I<Node>Element x = wdContext.node<node>().create<node>Element();
    WdContext.node<Node>().addElement(x);
    x.set<AttributeName>("Value");
    <b><u>Example:</u></b>
    for ( int i=0;i<=10;i++){
    IPrivateBusinessGraphicsView.ITestElement x = wdContext.nodeTest().createTestElement();
    wdContext.nodeTest().addElement(x);
    x.setMyAttr("100"+i);
    x.setMyAttr("2000"+i);
    This must be  solve your Problem
    Regards,
    <b>Ramganesan K</b>

  • How to add multiple records in table thru form via Submit button

    Hi all
    i have small requirement as follows.
    i have a view in which i have 3 UI elements one is webdynpro form,Table UI element and third one is submit button.
    now at runtime when i will enter the details in the form and click on the submit button then those record details has been stored in Table. then next time again when i submit the form with details then the table contains all records of current and existing ...so table has to maintain mutile records thru form via submit form..
    i need sample code on the same.
    points are always rewardable
    Thanks
    Sunil

    Hi,
    Create one context attribute and map it to the Inputfiled and one submit button, create a node with a valueattribute map it to a Table and in onActionsubmit write this code
    public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionsubmit(ServerEvent)
        String str=wdContext.currentContextElement().getInputfiledattribute();
        IPrivateTableformView.ITablenodeNode node=wdContext.nodeTablenode();
       IPrivateTableformView.ITablenodeElement ele=node.createTablenodeElement();
       ele.setNodeattribute(str);
       node.addElement(ele);
        //@@end
    thanx,
    ramani.p

  • How to show data in table on the basis of click on a row of another table

    Hi All,
    I want to show two tables. In first table the main objects show in turn there is another collection in that main object for which i want to show data in separate table.
    e.g.,
    ObjectA
      have the collection of ObjectBs
    when i select ObjectA in main table then all the collection Objects of ObjectBs shows in separate table. Plz help me how to handle this case ??

    hi,
    You can create two value nodes for storing these collections. The first one would be singleton node as it is the main list. Under that create the second node with singleton = false.
    e.g.
    ---NodeA
        --attrA1
        --attrA2
        --NodeB(singleton = false)
                --attrB1
                --attrB2
    Now populate collection of object A in NodeA and after adding element in NodeA populate respective elements in NodeB.
    IPrivate<View>View.INodeANode nodeA = wdContext.NodeAnode();
    for (Iterator  it = collectionA.iterator(); it.hasNext(); )
         ObjectA objA= it.next();
         IPrivate<View>View.INodeAElement nodeAElem= nodeA.createNodeAElement();
         wdCopyservice.copy Corresponding(objA,nodeAElem);
         nodeA.addElement(nodeAElem);
         Collection collectioB =objA.getCollectionB();
         for (Iterator  it1 = collectionB.iterator(); it1.hasNext(); )
             ObjectB objB= it1.next();
            IPrivate<View>View.INodeBNode nodeB = nodeAElem.nodeBnode();
            IPrivate<View>View.INodeAElement nodeBElem= nodeB.createNodeBElement();
            wdCopyservice.copy Corresponding(objB,nodeBElem);
            nodeB.addElement(nodeBElem);
    Bind NodeA to the first table and NodeB to second one.
    After that when you select record in first table automatically its corresponding records will be populated in second table.
    Hope this helps!
    Monalisa

  • Populate Values for Drop Down by Index in Table in Web Dynpro Java

    Hi Experts,
    I have a table and having a column table cell editor as Drop Down by Index.
    I have created the table node (tbnode) and child node for DDBI (ddbinode) and set the singleton property for DDBI node to false.
    I have same local variable node as same as above node and the values are available.
    I have one button ADD.On click the add button i need to populate the values to table node and as well as DDBI Node.
    I created supply function for DDBI node and populate the values for DDBI Node.
    Add Method:
    IPrivateMdTest8CompView.ItbnodeElement tbnode = wdContext.nodetbnode().createtbnodeElement();
    tbnode.setDescription(wdContext.currentCn_LocalVariableElement().getDescription);
    wdContext.nodetbnode().addElement(tbnode);
    Supply Function Method:
    for(int j=0;j<wdContext.nodetbnode().size();j++)
    wdContext.nodeddbinode().setLeadSelection(j);
    IPrivateMdTest8CompView.IddbinodeElement ddbinode = wdContext.nodeddbinode().createddbinodeElement();
    ddbinode.setddvalue(wdContext.currentCn_localddvalueElement().getddvalue);
    wdContext.nodeddbinode().addElement(ddbinode);
    Problem is one i got the values in the drop down and i click the second row in table again the supply function calls and reset the first row drop down to original value.
    If you any problem like please provide the solution.
    Thanks & Regards,
    SatheshKumar R

    If you created the supply method by setting the supply property of the node, you should have variable 'node' available as argument of the supply method, which will be related to the table row of the triggered dropdown. Opening the dropdown does not change the lead selection of the parent node, so
    ddbinode = wdContext.nodeddbinode().createddbinodeElement();
    wdContext.nodeddbinode().addElement(ddbinode);
    does always relate to the first row of the table (given that leadSelection == 0). With the node variable you can
    IddbinodeElement ddbiElement = node.createddbinodeElement();
    node.addElement(ddbiElement);

  • Java.lang.NullPointerException: When Get the PDF File Name

    Hi,
    i try to follow the blog on <b>Handling FileUpload and FileDownload in NetWeaver Developer Studio(NWDS) 2004S</b> on /people/rekha.malavathu2/blog/2006/12/12/handling-fileupload-and-filedownload-in-netweaver-developer-studionwds-2004s
    as i create a fileupload and i wish to get the file name and the pdf, then i to run and deploy it but i get <b>java.lang.NullPointerException</b>
    the code are as below when i click on send email button
    IPrivateEmail.IFileUploadNodeNode node = wdContext.nodeFileUploadNode();
    IPrivateEmail.IFileUploadNodeElement fileUploadEle = node.createFileUploadNodeElement();
         try{
         IWDResource resource = WDResourceFactory.createResource(wdContext.currentContextElement().getFileUploadUI().read(true), wdContext.currentContextElement().getFileUploadUI().getResourceName(), WDWebResourceType.PDF, true);
         fileUploadEle.setFileUploadAttr(resource);
         fileUploadEle.setFileUploadName(wdContext.currentContextElement().getFileUploadUI().getResourceName());
         node.addElement(fileUploadEle);
         }catch(Exception e){
         wdComponentAPI.getMessageManager().reportSuccess("ERROR"+e.getMessage());
    but i wonder which part of the code i did wrongly.. as i wish to insert into my send email code
    Properties props = new Properties();
              String host = "SMTP HOST";
              props.put("mail.smtp.host", host);
              Session session = Session.getInstance(props, null);
              MimeMessage message = new MimeMessage(session);
              Address toAddress = new InternetAddress();
              Address fromAddress = new InternetAddress();
              Address ccAddress = new InternetAddress();
              Address bccAddress = new InternetAddress();
              try
                   MimeMultipart multipart = new MimeMultipart();
                   BodyPart messageBodyPart = new MimeBodyPart();
                   if (! wdContext.currentEmailElement().getFrom().equals(""))
                        fromAddress = new InternetAddress(wdContext.currentEmailElement().getFrom());               
                        message.setFrom(fromAddress);
                   if (! wdContext.currentEmailElement().getTo().equals(""))
                        toAddress = new InternetAddress(wdContext.currentEmailElement().getTo());
                        message.setRecipient(Message.RecipientType.TO, toAddress);
                   if (! wdContext.currentEmailElement().getCc().equals(""))
                        ccAddress = new InternetAddress(wdContext.currentEmailElement().getCc());
                        message.setRecipient(Message.RecipientType.CC, ccAddress);
                   if (! wdContext.currentEmailElement().getBcc().equals(""))
                        bccAddress = new InternetAddress(wdContext.currentEmailElement().getBcc());
                        message.setRecipient(Message.RecipientType.BCC, bccAddress);
                   if (! wdContext.currentEmailElement().getSubject().equals(""))
                        message.setSubject(wdContext.currentEmailElement().getSubject());
                   if (! wdContext.currentEmailElement().getBody().equals(""))
                        messageBodyPart.setText(wdContext.currentEmailElement().getBody());
                   multipart.addBodyPart(messageBodyPart);
                   messageBodyPart = new MimeBodyPart();
                   String filename = IWDResource.getResourceName();
                   DataSource source = new FileDataSource(filename);
                   messageBodyPart.setDataHandler(new DataHandler(source));
                   messageBodyPart.setFileName(source.getName());                    
                   messageBodyPart.setHeader("Content-Type","application/pdf");
                   multipart.addBodyPart(messageBodyPart);
                   message.setContent(multipart);
                   Transport.send(message);
              catch (AddressException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (SendFailedException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (MessagingException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
    so i wonder could anyone help me out.. as i need to get the pdf filename order to put into the variable call <b>filename</b> at the send mail code.
    below is the error message
    java.lang.NullPointerException
         at com.sap.example.uploademail.Email.wdDoInit(Email.java:124)
         at com.sap.example.uploademail.wdp.InternalEmail.wdDoInit(InternalEmail.java:146)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:748)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:283)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    facing same issue.
    jdev 10.1.3.3.0, on expanding the database connection, I get a null pointer exception.
    On the testing the connection it says 'success' though.
    any inputs ?

Maybe you are looking for

  • Unable to generate the XML file through SQL script. getting error PLS-00306

    I am fetching the data from cursor and generating the xml output I am getting the below error. When I have checked the cursor query it is fetching the data in to single column. Input truncated to 1 characters Enter value for 7: EXEC FND_CONC_STAT.COL

  • Brand new macbook battery won't charge

    Hello! I bought a new battery for My Macbook Pro 15 Early 2011 (unibody) The controller sees the battery, it discharges when power supply disconnected, but it does not charge when MagicSafe is plug in. Green light is always green, controller dont swi

  • Separating logs in OSB based on project - is this possible?

    Hi, I'm using OSB 11.1.1.3.0 and I'd like log messages generated from the log action to go to a different log file based on OSB project. I've found messages on the forum that discuss this, for example: alsb logging These posts only explain how to log

  • ATT can't tether/hotspot and do voice at same time?

    While using the new hotspot feature in IOS6 on a 4S, I can't tether/hotspot and do a voice call at the same time. It appears to pause the clients on the hotspot, although data directly from applications on the phone seem to work. I understand Verizon

  • N85 bugs/wishlist for future updates!

    Hi.... just wanted to post some bugs and wishlist(necessities) for the next firmware upgrade.... 1) Show date and time the message was sent when you read a message in the message screen instead of having to go to details. 2) Repair/Update the multime