This discussion is archived
1 Reply Latest reply: Feb 8, 2013 1:32 AM by Timo Hahn RSS

error Inserting Rows  to ADF View Object Programatically

adf009 Explorer
Currently Being Moderated
hi am trying to insert rows from another view to another ,following this sample some how am not able to read my view i got the error in this line ViewObject targetVO = obj.getViewObject(); when i click my add button. am i jedeveloper i did create public class UpdAppModuleImpl in my application module i can see the view
my log error is
Caused by: java.lang.NullPointerException
     at OrgDetails.updAddMember(
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
     at java.lang.reflect.Method.invoke(
     at com.sun.el.parser.AstValue.invoke(Unknown Source)
     at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
     at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(
     at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(
     at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(
     at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(
     at org.apache.myfaces.trinidad.component.UIXTable.broadcast(
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(
     at javax.faces.webapp.FacesServlet.service(
     ... 38 more
this is my code
    public void updAddMember(ActionEvent actionEvent) {
        // Add event code here...
        //Code to get the bindings for TargetVO :
                DCBindingContainer bindings2 =
               JUCtrlHierBinding obj = (JUCtrlHierBinding)bindings2.findCtrlBinding("UpdAddedMember1");
               ViewObject targetVO = obj.getViewObject();

          DCBindingContainer bindings =
               DCIteratorBinding empIter =

        //SourceVO1Iterator is the iterator under Executables section for the SourceVO1 bindings.

               RowSetIterator roleRSIters = empIter.getRowSetIterator();
               RowSetIterator rs1 = roleRSIters.getRowSet().getViewObject().createRowSetIterator(null);
               NameValuePairs nvp = null;

               while (rs1.hasNext()) {
                   Key key =;
                   Row r = rs1.getRow(key);           
                   nvp = new NameValuePairs();
Edited by: adf009 on 2013/02/08 11:17 AM

Edited by: adf009 on 2013/02/08 11:22 AM
  • 1. Re: error Inserting Rows  to ADF View Object Programatically
    Timo Hahn Oracle ACE
    Currently Being Moderated
    adf009, a simple NPE?
    You know how to use a debugger?
    You already know that
                   JUCtrlHierBinding obj = (JUCtrlHierBinding)bindings2.findCtrlBinding("UpdAddedMember1");
    return null. What information do you get by that?
    It telling me that you misspelled the binding name 'UpdAddedMember1' or that it does not exist in the bindings of the page.

    Next you use 'bindings ' and 'bindings2' which are equal. Meanaing you only need one of them.

    What is that code fore:
    while (rs1.hasNext()) {
                       Key key =;
                       Row r = rs1.getRow(key);           
    you iterate over a row set with the and then jump to the already selected row by setting the row with row.getRow(key);
    while (rs1.hasNext()) {
                       Row r =;           
    should do.



  • Correct Answers - 10 points
  • Helpful Answers - 5 points