8 Replies Latest reply on Feb 20, 2013 11:11 AM by Daniel015

    not able to insert row programticaly

      hi am trying to insert row to another viewObject from another viewobject programaticaly ,can somebody help me,i have recreate the problem i upload it in hostfile,am in jdeveloper

      am geting this log error
      Caused by: oracle.jbo.InvalidOwnerException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-25030. Error message parameters are {0=UamUserdetails, 1=oracle.jbo.Key[marksn ]}
           at oracle.jbo.server.EntityImpl.internalCreate(EntityImpl.java:1341)
           at oracle.jbo.server.EntityImpl.create(EntityImpl.java:1020)
           at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:1197)
           at oracle.jbo.server.ViewRowStorage.create(ViewRowStorage.java:1152)
           at oracle.jbo.server.ViewRowImpl.create(ViewRowImpl.java:498)
           at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:515)
           at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:5714)
           at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1993)
           at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2492)
           at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2533)
           at oracle.jbo.server.ViewRowSetImpl.createAndInitRow(ViewRowSetImpl.java:2498)
           at oracle.jbo.server.ViewObjectImpl.createAndInitRow(ViewObjectImpl.java:11042)
           at worklis.view.beantest.addnew(beantest.java:138)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           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(MethodExpressionMethodBinding.java:53)
           at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
           at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
           at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
           at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:279)
           at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:145)
           at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
           at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      Edited by: adf009 on 2013/02/15 4:43 PM

      Edited by: adf009 on 2013/02/15 4:57 PM

      Edited by: adf009 on 2013/02/15 7:22 PM
        • 1. Re: not able to insert row programticaly
          Frank Nimphius-Oracle

          can you paste the code that you use to create the row?

          • 2. Re: not able to insert row programticaly
            the code am using is below
                public void addnew(ActionEvent actionEvent) {
                    // Add event code here...
                    // Add event code here...
                    //Code to get the bindings for TargetVO :
                    Map<Object,String> mp=new HashMap<Object, String>();
                            DCBindingContainer bindings2 =
                           JUCtrlHierBinding obj = (JUCtrlHierBinding)bindings2.findCtrlBinding("UamUserdetailsView2");
                           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;
                           String username = null;
                    while (rs1.hasNext()) {
                                       Row r = rs1.next();   
                               nvp = new NameValuePairs();
                              // nvp.setAttribute("organisationid", r.getAttribute("organisationid"));
                               nvp.setAttribute("Organisationid", getorgid());
                               System.out.println("printedorgid" +getorgid());
                               // username = (String)r.getAttribute("Username");
                               System.out.println("prininstead " + nvp);
                             //  targetVO.createAndInitRow(nvp);
                                r = targetVO.createAndInitRow(nvp);
                                //createAndInitRow(AttributeList nvp); 
                    //Row row = targetVO.createAndInitRow(nvp);
                      //      targetVO.insertRow(row);
            i have re-created the problem i upload in this hostfile,you can have the whole picture of what am trying to do
            Edited by: adf009 on 2013/02/15 7:36 PM

            Edited by: adf009 on 2013/02/15 7:38 PM

            Edited by: adf009 on 2013/02/15 8:01 PM
            • 3. Re: not able to insert row programticaly
              Timo Hahn
              adf009, this is a continuation of your previous post {thread:id=2497655}
              Nice that you have created a test case, however, this case can only be loaded if we register to the share hoster. I doubt that anyone will do this.

              Next I hope that your test case is build on a db schema like HR or that you included scripts to generate the tables needed and provided test data. Last but not least I hope you have included instructions on what to do to see the problem.

              • 4. Re: not able to insert row programticaly
                ok i have upload the file in this link http://www.filehosting.org/file/details/420502/createRow.zip or this file host http://www.filedropper.com/createrow
                if you what to see the problem navigate to next page and go to second tab and try to click the add button you will see the error can also check this file hosting <img src=http://www.filedropper.com/download_button.png width=127 height=145 border=0/>
                <div style=font-size:9px;font-family:Arial, Helvetica, sans-serif;width:127px;font-color:#44a854;> share files free</div>

                Edited by: adf009 on 2013/02/16 8:00 AM

                Edited by: adf009 on 2013/02/16 11:34 AM
                • 5. Re: not able to insert row programticaly
                  Timo Hahn
                  adf009, you need to pay more attention. You sample can't be loaded as some parts of the db are missing (sequences are missing and some table definition).

                  Then I don't see a detailed description on what to do. I guess you are on your own with this.

                  • 6. not able to insert row programaticaly
                    hi i was able to correct my script i test them using plain schema is working you can just copy and paste them in sql*plus
                    http://www.filedropper.com/createrow_1 or this <img src=http://www.filedropper.com/download_button.png width=127 height=145 border=0/>
                    <div style=font-size:9px;font-family:Arial, Helvetica, sans-serif;width:127px;font-color:#44a854;> online backup</div> has anybody able to check my problem,if there is something not clear let me know

                    Edited by: adf009 on 2013/02/18 9:53 AM
                    • 7. Re: not able to insert row programticaly
                      Timo Hahn
                      I spend some time on your test case. I was still not able to create/load the db with your scripts (I'm not using sqlplus). There are some problems with the locale (not your fault). OK, I managed to tweak the scripts and get most of the data in. All in all the DB looks OK (some rows are missing).

                      The code is a mess! You should at least format the code and comment it in a way that on can understand what you are doing in the code. This is your main problem. I have the feeling that you don't know what you want to do, and so just copied code from different soureces hoping that it'll work out. My feeling is that you don't know what the code you copied is doing as you left some parts out (which were vital for the code to work).

                      After spending some time figuring out how to start the application (Yes you did not tell us how to start, even after I ask you to provide this info), I got to the selection page which shows a lov with lots of data. Problem, I don't know what to do next. Which element to select? what to do next. I tried to hit the selectwith... button and got an NPE! This is the part where you did not copy all code or follow the instructions from the blog you got the code from (I know hte code because I've written it myself!). I fixed the NPE.

                      Next page it's getting even worse. Lov which should be dependent but are not working, lots of stuff which we (or at least I) don't know how to deal with. I don't like to spend time figuring all this out! took me an hour to get to this point and I'm not wasting more time to go any further.

                      My advice to you is document each line of code and let a college then read it. If he understands what's going on and why, you are on the right way.
                      A sample which is not working, where the code is totally without comment and no detailed instruction on how to get to the real problem is just wasting time.

                      • 8. not able to insert row programticaly
                        the instruction,on how to use the application is

                        1.select value/organisationname in lov
                        2.click the button to navigate to next page
                        3.display value based on lov selection
                        4.navigate to panneltabbed
                        5.go to second tab
                        6.go to search query
                        7.click the search query
                        8.display all users
                        9.click the add new button from the table->this is where the error occurs when you click the add button it suppose to add value to second table

                        i have use the class beantest which is under Application Sources in package worklis.view.beantest

                        i have used the method called public void addnew(ActionEvent actionEvent) to create new row progaramticaly

                        i only what you o check this method,why is not able to add new or create row in another view= public void addnew(ActionEvent actionEvent)

                        don't worry about the lov am able to do that in my application its working fine,i just what to be able to add/create row to another table ,the problem i like you to help me with is in second tab of <af:panelTabbed id="pt1">

                        i have fix the lov error,and you can also navigate based on lov selection,i just what to be able to add/create row in another view based on the selection of first view,if you navigate to next page and the address details is empty,i what the that to be able to be in insert mode

                        i have uploaded the file in this hostfile

                        i have no one to help me,the forum is the only place i can get help

                        the lov are working fine now only the second tab not working to add new values to another table is not working

                        Edited by: adf009 on 2013/02/20 2:10 PM