Wie kann ich über AJO das Tippkommando zum Buchen von offenen Posten starten?

Datenbankkommandos werden in AJO über die Methode

  EditorCommand EditorCommandFactory.create(EditorAction action, String databaseName, String groupName, String reference, String menuChoice)

erstellt. Diese können dann per

DbContext.openEditor(EditorCommand command)

ausgeführt werden, was eine entsprechende Editor-Instanz zurückliefert.

Im konkreten Fall sieht die Anwendung wie folgt aus:

EditorCommand command = EditorCommandFactory.create(EditorAction.PAYMENT, "3", "", "", "offene Posten ausbuchen");
EditorObject editor = getContext().openEditor(command);
if (editor instanceof OutstandingPaymentsEditor) {
   OutstandingPaymentsEditor outstandingPayments = (OutstandingPaymentsEditor) editor;
   for (OutstandingPaymentsEditor.Row item : outstandingPayments.table().getEditableRows()) {
      // die offenen Posten in der Tabelle entsprechend bearbeiten
      item.setDataRecIdOI(...);
   }
}

Leave a comment

Design a site like this with WordPress.com
Get started