use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class AssignmentPreviewDialog method initLayout.
public void initLayout() {
List<IColumn<AssignmentsPreviewDto, String>> columns = initColumns();
ListDataProvider provider = new ListDataProvider(pageBase, data);
WebMarkupContainer content = new WebMarkupContainer(ID_CONTENT);
content.setOutputMarkupId(true);
add(content);
TablePanel table = new TablePanel<>(ID_TABLE, provider, columns);
table.setOutputMarkupId(true);
content.add(table);
AjaxButton addButton = new AjaxButton(ID_BUTTON_ADD, createStringResource("userBrowserDialog.button.selectButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<AssignmentsPreviewDto> previewDtos = data.getObject();
List<AssignmentsPreviewDto> selectedDtos = new ArrayList<>();
for (AssignmentsPreviewDto dto : previewDtos) {
if (dto.isSelected()) {
selectedDtos.add(dto);
}
}
AssignmentPreviewDialog.this.addButtonClicked(target, selectedDtos);
}
};
addButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return multiselect;
}
});
content.add(addButton);
AjaxButton cancelButton = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("AssignmentPreviewDialog.button.cancel")) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
((PageBase) getPage()).hideMainPopup(ajaxRequestTarget);
}
};
content.add(cancelButton);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class OrgUnitAddDeletePopup method setState.
public void setState(ActionState state, AjaxRequestTarget target) {
this.state = state;
AjaxButton actionButton = (AjaxButton) getContent().get(ID_BUTTON_ACTION);
actionButton.setModel(createActionButtonStringResource());
actionButton.add(new AttributeAppender("class", getActionButtonClass()));
target.add(actionButton);
TablePanel panel = getTable();
DataTable table = panel.getDataTable();
ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
provider.setQuery(getDataProviderQuery());
target.add(panel);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class MergeObjectsPanel method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
DropDownChoicePanel mergeTypeSelect = new DropDownChoicePanel(ID_MERGE_TYPE_SELECTOR, mergeTypeModel, mergeTypeChoicesModel);
mergeTypeSelect.getBaseFormComponent().add(new OnChangeAjaxBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
mergeResultObject = getMergeObjectsResult();
WebMarkupContainer resultObjectPanel = (WebMarkupContainer) get(ID_FORM).get(ID_OBJECTS_PANEL).get(ID_MERGE_RESULT_PANEL_CONTAINER);
resultObjectPanel.addOrReplace(getMergeResultObjectPanel());
target.add(resultObjectPanel);
}
});
mergeTypeSelect.setOutputMarkupId(true);
mainForm.add(mergeTypeSelect);
final WebMarkupContainer objectsPanel = new WebMarkupContainer(ID_OBJECTS_PANEL);
objectsPanel.setOutputMarkupId(true);
mainForm.addOrReplace(objectsPanel);
initObjectsPanel(objectsPanel);
AjaxButton switchDirectionButton = new AjaxButton(ID_SWITCH_DIRECTION_BUTTON, pageBase.createStringResource("MergeObjectsPanel.switchDirection")) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
F temp = mergeObjectModel.getObject();
mergeObjectModel.setObject(mergeWithObjectModel.getObject());
mergeWithObjectModel.setObject(temp);
initObjectsPanel(objectsPanel);
ajaxRequestTarget.add(objectsPanel);
}
};
switchDirectionButton.setOutputMarkupId(true);
mainForm.add(switchDirectionButton);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class DoubleButtonPanel method initLayout.
private void initLayout() {
AjaxButton firstButton = new AjaxButton(ID_BUTTON_FIRST, createButtonStringResource(getFirstCaption())) {
@Override
public void onClick(AjaxRequestTarget target) {
firstPerformed(target, DoubleButtonPanel.this.getModel());
}
@Override
public boolean isEnabled() {
return isFirstEnabled(DoubleButtonPanel.this.getModel());
}
};
firstButton.add(new AttributeAppender("class", getFirstCssClass()));
AjaxButton secondButton = new AjaxButton(ID_BUTTON_SECOND, createButtonStringResource(getSecondCaption())) {
@Override
public void onClick(AjaxRequestTarget target) {
secondPerformed(target, DoubleButtonPanel.this.getModel());
}
@Override
public boolean isEnabled() {
return isSecondEnabled(DoubleButtonPanel.this.getModel());
}
};
secondButton.add(new AttributeAppender("class", getSecondCssClass()));
add(firstButton);
add(secondButton);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class SchemaStep method initLayout.
private void initLayout() {
List<ITab> tabs = new ArrayList<>();
tabs.add(createSimpleSchemaView());
tabs.add(createSchemaEditor());
TabbedPanel<ITab> tabPanel = new TabbedPanel<>(ID_TAB_PANEL, tabs);
tabPanel.setOutputMarkupId(true);
add(tabPanel);
AjaxButton reload = new AjaxButton(ID_RELOAD, createStringModel("SchemaStep.button.reload")) {
@Override
public void onClick(AjaxRequestTarget target) {
reloadPerformed(target);
}
};
add(reload);
}
Aggregations