0 Replies Latest reply: Feb 14, 2013 6:32 AM by Tshifhiwa RSS

    how do i put the row into the target rowset

    Tshifhiwa
      hi am trying to add new row to another table,by selecting taking values from one table to another,i have below code but its not adding vlues,how can i Creates and initializes a new Row object, and insert it into the Row Set.
      my code is
          public void updAddMember(ActionEvent actionEvent) {
              // Add event code here...
              //Code to get the bindings for TargetVO :
              OIDOperations   oIDOperations= new  OIDOperations();
              Map<Object,String> mp=new HashMap<Object, String>();
                      DCBindingContainer bindings2 =
                         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                          
                     JUCtrlHierBinding obj = (JUCtrlHierBinding)bindings2.findCtrlBinding("UserDetailsViewVO1");
                     ViewObject targetVO = obj.getViewObject();
      
      
                DCBindingContainer bindings =
                         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                     DCIteratorBinding empIter =
                         bindings.findIteratorBinding("DeltMember1Iterator");
      
              //SourceVO1Iterator is the iterator under Executables section for the SourceVO1 bindings.
      
              RowSetIterator roleRSIters = empIter.getRowSetIterator();
              RowSetIterator rs1 = roleRSIters.getRowSet().getViewObject().createRowSetIterator(null);
              rs1.first();
                     NameValuePairs nvp = null;
                     
                     String username = null;
      
              while (rs1.hasNext()) {
                                 Row r = rs1.next();   
          
                        
                         nvp = new NameValuePairs();                 
                         nvp.setAttribute("Organisationid", getorgid());
                         System.out.println("printedorgid" +getorgid());
                         nvp.setAttribute("Username",r.getAttribute("Username"));
                          nvp.setAttribute("Username1",r.getAttribute("Username"));
                         nvp.setAttribute("Firstname",r.getAttribute("Firstname"));
                         nvp.setAttribute("Surname",r.getAttribute("Surname"));
                         nvp.setAttribute("Emailaddress",r.getAttribute("Emailaddress"));                   
                         targetVO.createAndInitRow(nvp);
                           
                         
                      }
              
             
                     rs1.closeRowSetIterator();
                     targetVO.getApplicationModule().getTransaction().commit();
          }
      Edited by: adf009 on 2013/02/14 10:20 AM

      Edited by: adf009 on 2013/02/14 3:32 PM