Advertisement
psi_mmobile

Untitled

Jul 19th, 2017
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1.     public void personRoleDialogListener(DialogEvent dialogEvent) {
  2.         AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
  3.         ViewObjectImpl personRolesView = am.getPersonRolesView1();
  4.         RowQualifier voRolePersonIdRowQualifier = new RowQualifier(personRolesView);
  5.         if (dialogEvent.getOutcome() == DialogEvent.Outcome.ok) {
  6.             Row[] selectedRoles = getRowsMarkedForAction();
  7.             for (Row role : selectedRoles) {
  8.                 Row newRoleToInsert = personRolesView.createRow();
  9.                 voRolePersonIdRowQualifier.setWhereClause("VoRoleId=" + role.getAttribute("VoRoleId1") +
  10.                                                           " AND PersonId=" +
  11.                                                           ContextBean.getCurrent().getSelectedPersonId());
  12.                 if (personRolesView.getFilteredRows(voRolePersonIdRowQualifier).length == 0) {
  13.                     newRoleToInsert.setAttribute("PersonId", ContextBean.getCurrent().getSelectedPersonId());
  14.                     newRoleToInsert.setAttribute("VoRoleId", role.getAttribute("VoRoleId1"));
  15.                     personRolesView.insertRow(newRoleToInsert);
  16.                 }
  17.             }
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement