Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void personRoleDialogListener(DialogEvent dialogEvent) {
- AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
- ViewObjectImpl personRolesView = am.getPersonRolesView1();
- RowQualifier voRolePersonIdRowQualifier = new RowQualifier(personRolesView);
- if (dialogEvent.getOutcome() == DialogEvent.Outcome.ok) {
- Row[] selectedRoles = getRowsMarkedForAction();
- for (Row role : selectedRoles) {
- Row newRoleToInsert = personRolesView.createRow();
- voRolePersonIdRowQualifier.setWhereClause("VoRoleId=" + role.getAttribute("VoRoleId1") +
- " AND PersonId=" +
- ContextBean.getCurrent().getSelectedPersonId());
- if (personRolesView.getFilteredRows(voRolePersonIdRowQualifier).length == 0) {
- newRoleToInsert.setAttribute("PersonId", ContextBean.getCurrent().getSelectedPersonId());
- newRoleToInsert.setAttribute("VoRoleId", role.getAttribute("VoRoleId1"));
- personRolesView.insertRow(newRoleToInsert);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement