Skip to content

Commit

Permalink
Fixed setting page size for tables related to certification.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Dec 9, 2015
1 parent 8c2703d commit 9b34e43
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 28 deletions.
Expand Up @@ -257,11 +257,12 @@ private void initTableLayout(Form mainForm) {
provider.setQuery(createCaseQuery());
provider.setCampaignOid(getCampaignOid());
provider.setSort(AccessCertificationCaseType.F_OBJECT_REF.getLocalPart(), SortOrder.ASCENDING); // default sorting
int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_DECISIONS_PANEL);
BoxedTablePanel table = new BoxedTablePanel<>(ID_DECISIONS_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_DECISIONS_PANEL,
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_DECISIONS_PANEL));
UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_DECISIONS_PANEL, itemsPerPage);
table.setShowPaging(true);
table.setOutputMarkupId(true);
table.setItemsPerPage(itemsPerPage);
mainForm.add(table);
}

Expand Down
Expand Up @@ -262,12 +262,13 @@ public void yesPerformed(AjaxRequestTarget target) {
});

CertCampaignListItemDtoProvider provider = createProvider();
int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_CAMPAIGNS_PANEL);
BoxedTablePanel<CertCampaignListItemDto> table = new BoxedTablePanel<>(
ID_CAMPAIGNS_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_CERT_CAMPAIGNS_PANEL,
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_CAMPAIGNS_PANEL));
UserProfileStorage.TableId.PAGE_CERT_CAMPAIGNS_PANEL, itemsPerPage);
table.setShowPaging(true);
table.setOutputMarkupId(true);
table.setItemsPerPage(itemsPerPage);
mainForm.add(table);
}

Expand Down
Expand Up @@ -116,26 +116,6 @@ private CertDecisionDtoProvider createProvider() {

private ObjectQuery createCaseQuery() {
ObjectQuery query = new ObjectQuery();

// implemented as a special notDecidedOnly parameter
// Boolean notDecidedOnly = showNotDecidedOnlyModel.getObject();
// if (Boolean.TRUE.equals(notDecidedOnly)) {
//
// PrismContainerDefinition pcd = getPrismContext().getSchemaRegistry().findContainerDefinitionByCompileTimeClass(AccessCertificationCaseType.class);
//
// ObjectFilter filter;
// try {
// filter = OrFilter.createOr(
// EqualFilter.createEqual(new ItemPath(AccessCertificationCaseType.F_DECISION,
// AccessCertificationDecisionType.F_RESPONSE), pcd, null),
// EqualFilter.createEqual(new ItemPath(AccessCertificationCaseType.F_DECISION,
// AccessCertificationDecisionType.F_RESPONSE), pcd, AccessCertificationResponseType.NO_RESPONSE));
// } catch (SchemaException e) {
// throw new SystemException("Unexpected schema exception: " + e.getMessage(), e);
// }
//
// query.setFilter(filter);
// }
return query;
}

Expand All @@ -160,9 +140,9 @@ private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
CertDecisionDtoProvider provider = createProvider();
int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL);
BoxedTablePanel table = new BoxedTablePanel(ID_DECISIONS_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL,
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL)) {
UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL, itemsPerPage) {

@Override
protected WebMarkupContainer createHeader(String headerId) {
Expand All @@ -171,6 +151,7 @@ protected WebMarkupContainer createHeader(String headerId) {
};
table.setShowPaging(true);
table.setOutputMarkupId(true);
table.setItemsPerPage(itemsPerPage); // really don't know why this is necessary, as e.g. in PageRoles the size setting works without it
mainForm.add(table);

// adding this on outer feedback panel prevents displaying the error messages
Expand Down
Expand Up @@ -120,11 +120,12 @@ public void yesPerformed(AjaxRequestTarget target) {
deleteDefinitionPerformed(target, singleDelete);
}
});
int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_DEFINITIONS_PANEL);
BoxedTablePanel table = new BoxedTablePanel<>(ID_DEFINITIONS_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_CERT_DEFINITIONS_PANEL,
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_DEFINITIONS_PANEL));
UserProfileStorage.TableId.PAGE_CERT_DEFINITIONS_PANEL, itemsPerPage);
table.setShowPaging(false);
table.setOutputMarkupId(true);
table.setItemsPerPage(itemsPerPage);
mainForm.add(table);
}

Expand Down

0 comments on commit 9b34e43

Please sign in to comment.