2016-06-15 5 views
1

ich programmatisch versuche einen Rekord ohne Schlüsselreferenz zu ändern, in Bildschirm geänderten Datensatz es zeigt den geänderten Wert, aber in der Tabelle nichtaktualisieren einen Datensatz programmatisch in adf, ohne Schlüsselreferenz

ich dort stecken bitte vorschlagen

Ich habe den folgenden Code enthalten.

public String modifybank() { 
    String st=""+soc3.getValue(); 
    System.out.println(st); 
    String bname=""+soc4.getValue(); 
    String acno=""+it7.getValue(); 
    String amDef = "model.AppModule"; 
    String config = "AppModuleLocal"; 
    ApplicationModule ami = 
     Configuration.createRootApplicationModule(amDef, config); 
    AppModuleImpl am = (AppModuleImpl)ami; 
    ViewObjectImpl demo1 =am.getCmbBankdetailsModifyView1(); 
    DCBindingContainer bindings1 = 
     (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
    DCIteratorBinding branchItem; 
    branchItem = 
     (DCIteratorBinding)bindings1.get("CmbBankdetailsModifyView1Iterator"); 
    Row r2 = branchItem.getCurrentRow(); 
    System.out.println("acc"+r2.getAttribute("Accountno")); 
    r2.setAttribute("Accountno", acno); 
    r2.setAttribute("Bankname", bname); 
    r2.setAttribute("Status", st); 
    //demo1.insertRow(currentRow); 
    am.getDBTransaction().commit(); 
    //branchItem. 
    branchItem.executeQuery(); 

    return null; 
} 
+0

mich korrigieren, wenn ich Ihre Frage nicht richtig verstanden habe ... In Iterator Änderungen erscheinen, aber Sie nicht sehen, wie sie in UI-Komponente (Tabelle oder Liste)? – vssk

+0

in meinem lokalen db @ vssk – Subashri

+0

Hat Ihre Überprüfung für eine Art von Fehlern im Protokoll? – vssk

Antwort

2

Zuerst Dont Update in ManagedBean Klasse. Erstellen Sie eine Methode in AMImpl und setzen Sie sie als ClientInterface frei. Dann in ManagedBean

DCBindingContainer bindingContainer = 
      (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
DCDataControl dc = 
     bindingContainer.findDataControl("YourDataControl"); 
YourApplicationModuleImpl am = (YourApplicationModuleImpl)dc.getDataProvider(); 

am.yourClientInterfaceMethod(); 

Innerhalb Ihres YourApplicationModuleImpl

yourClientInterfaceMethod() { 
    // Get the row and update it and commit 
    // You will have Getter method for your ViewObject in the same class 
} 
Verwandte Themen