use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class TestConnectionResultPanel method initLayout.
private void initLayout(Page parentPage) {
WebMarkupContainer contentPanel = new WebMarkupContainer(ID_CONTENT_PANEL);
contentPanel.setOutputMarkupId(true);
add(contentPanel);
Label messageLabel = new Label(ID_MESSAGE, ((PageBase) parentPage).createStringResource("TestConnectionResultPanel.message"));
messageLabel.setOutputMarkupId(true);
contentPanel.add(messageLabel);
messageLabel.add(new VisibleEnableBehaviour() {
public boolean isVisible() {
return !isLoaded;
}
});
AjaxLazyLoadPanel resultsPanel = new AjaxLazyLoadPanel(ID_RESULT) {
@Override
public Component getLazyLoadComponent(String id) {
return new TestConnectionMessagesPanel(id, resourceOid, (PageBase) parentPage);
}
@Override
protected void onComponentLoaded(Component component, AjaxRequestTarget target) {
isLoaded = true;
target.add(component);
target.add(messageLabel);
}
};
contentPanel.add(resultsPanel);
AjaxButton ok = new AjaxButton(ID_OK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getPageBase().hideMainPopup(target);
okPerformed(target);
}
};
contentPanel.add(ok);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class PageAccount method initButtons.
private void initButtons(Form mainForm) {
AjaxSubmitButton save = new AjaxSubmitButton("save", createStringResource("pageAccount.button.save")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
savePerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form) {
target.add(getFeedbackPanel());
}
};
save.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
ObjectWrapper wrapper = accountModel.getObject();
return !wrapper.isProtectedAccount();
}
});
mainForm.add(save);
AjaxButton back = new AjaxButton("back", createStringResource("pageAccount.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
cancelPerformed(target);
}
};
mainForm.add(back);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class AssignmentCatalogPanel method initCartButton.
private void initCartButton(WebMarkupContainer headerPanel) {
AjaxButton cartButton = new AjaxButton(ID_CART_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
}
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
pageBase.navigateToNext(PageAssignmentsList.class);
}
};
cartButton.add(new VisibleEnableBehaviour() {
public boolean isVisible() {
return !isCatalogOidEmpty();
}
});
cartButton.setOutputMarkupId(true);
headerPanel.add(cartButton);
Label cartItemsCount = new Label(ID_CART_ITEMS_COUNT, new LoadableModel<String>(true) {
private static final long serialVersionUID = 1L;
@Override
public String load() {
return Integer.toString(getRoleCatalogStorage().getAssignmentShoppingCart().size());
}
});
cartItemsCount.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
SessionStorage storage = pageBase.getSessionStorage();
if (storage.getRoleCatalog().getAssignmentShoppingCart().size() == 0) {
return false;
} else {
return true;
}
}
});
cartItemsCount.setOutputMarkupId(true);
cartButton.add(cartItemsCount);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class PageCertCampaign method initButtons.
private void initButtons(final Form mainForm) {
AjaxButton backButton = new AjaxButton(ID_BACK_BUTTON, createStringResource("PageCertCampaign.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(backButton);
AjaxSubmitButton startCampaignButton = new AjaxSubmitButton(ID_START_CAMPAIGN_BUTTON, createStringResource("PageCertCampaign.button.startCampaign")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
executeCampaignStateOperation(target, OP_OPEN_NEXT_STAGE);
}
};
startCampaignButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.CREATED;
}
});
mainForm.add(startCampaignButton);
AjaxButton nextStageButton = new AjaxButton(ID_OPEN_NEXT_STAGE_BUTTON, createStringResource("PageCertCampaign.button.openNextStage")) {
@Override
public void onClick(AjaxRequestTarget target) {
executeCampaignStateOperation(target, OP_OPEN_NEXT_STAGE);
}
};
nextStageButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.REVIEW_STAGE_DONE && campaignModel.getObject().getCurrentStageNumber() < campaignModel.getObject().getNumberOfStages();
}
});
mainForm.add(nextStageButton);
AjaxButton closeStageButton = new AjaxButton(ID_CLOSE_STAGE_BUTTON, createStringResource("PageCertCampaign.button.closeStage")) {
@Override
public void onClick(AjaxRequestTarget target) {
executeCampaignStateOperation(target, OP_CLOSE_STAGE);
}
};
closeStageButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.IN_REVIEW_STAGE;
}
});
mainForm.add(closeStageButton);
AjaxButton startRemediationButton = new AjaxButton(ID_START_REMEDIATION_BUTTON, createStringResource("PageCertCampaign.button.startRemediation")) {
@Override
public void onClick(AjaxRequestTarget target) {
executeCampaignStateOperation(target, OP_START_REMEDIATION);
}
};
startRemediationButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.REVIEW_STAGE_DONE && campaignModel.getObject().getCurrentStageNumber() == campaignModel.getObject().getNumberOfStages();
}
});
mainForm.add(startRemediationButton);
// TODO reenable when confirmation window is implemented
// AjaxButton closeCampaignButton = new AjaxButton(ID_CLOSE_CAMPAIGN_BUTTON,
// createStringResource("PageCertCampaign.button.closeCampaign")) {
//
// @Override
// public void onClick(AjaxRequestTarget target) {
// executeCampaignStateOperation(target, OP_CLOSE_CAMPAIGN);
// }
// };
// closeCampaignButton.add(new VisibleEnableBehaviour() {
// @Override
// public boolean isVisible() {
// return campaignModel.getObject().getState() != AccessCertificationCampaignStateType.CLOSED;
// }
// });
// mainForm.add(closeCampaignButton);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class PageAssignmentsList method initLayout.
public void initLayout() {
setOutputMarkupId(true);
Form mainForm = new Form(ID_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
AssignmentTablePanel panel = new AssignmentTablePanel<UserType>(ID_ASSIGNMENT_TABLE_PANEL, createStringResource("FocusType.assignment"), assignmentsModel, PageAssignmentsList.this) {
@Override
protected List<InlineMenuItem> createAssignmentMenu() {
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.unassign"), new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteAssignmentPerformed(target);
}
});
items.add(item);
return items;
}
};
mainForm.add(panel);
WebMarkupContainer targetUserPanel = new TargetUserSelectorComponent(ID_TARGET_USER_PANEL, PageAssignmentsList.this);
targetUserPanel.setOutputMarkupId(true);
mainForm.add(targetUserPanel);
TextArea descriptionInput = new TextArea<String>(ID_DESCRIPTION, descriptionModel);
descriptionInput.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
getSessionStorage().getRoleCatalog().setRequestDescription(getDescriptionComponent().getValue());
}
});
mainForm.add(descriptionInput);
AjaxButton back = new AjaxButton(ID_BACK, createStringResource("PageAssignmentDetails.backButton")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(back);
AjaxSubmitButton requestAssignments = new AjaxSubmitButton(ID_REQUEST_BUTTON, createStringResource("PageAssignmentsList.requestButton")) {
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
if (getSessionStorage().getRoleCatalog().getTargetUserList() == null || getSessionStorage().getRoleCatalog().getTargetUserList().size() <= 1) {
onSingleUserRequestPerformed(target);
} else {
onMultiUserRequestPerformed(target);
}
}
};
requestAssignments.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
return getSessionStorage().getRoleCatalog().isMultiUserRequest() || areConflictsResolved();
}
});
mainForm.add(requestAssignments);
AjaxSubmitButton resolveAssignments = new AjaxSubmitButton(ID_RESOLVE_CONFLICTS_BUTTON, createStringResource("PageAssignmentsList.resolveConflicts")) {
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
PageAssignmentsList.this.navigateToNext(PageAssignmentConflicts.class);
}
};
resolveAssignments.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !getSessionStorage().getRoleCatalog().isMultiUserRequest() && getSessionStorage().getRoleCatalog().getConflictsList() != null && getSessionStorage().getRoleCatalog().getConflictsList().size() > 0;
}
});
mainForm.add(resolveAssignments);
}
Aggregations