use of org.apache.wicket.model.CompoundPropertyModel in project syncope by apache.
the class HistoryConfDetails method initDropdownDiffConfForm.
private Form<?> initDropdownDiffConfForm() {
final Form<T> form = new Form<>("form");
form.setModel(new CompoundPropertyModel<>(selectedHistoryConfTO));
form.setOutputMarkupId(true);
final Map<String, String> namesMap = getDropdownNamesMap(availableHistoryConfTOs);
List<String> keys = new ArrayList<>(namesMap.keySet());
final AjaxDropDownChoicePanel<String> dropdownElem = new AjaxDropDownChoicePanel<>("compareDropdown", getString("compare"), new PropertyModel<>(selectedHistoryConfTO, "key"), false);
dropdownElem.setChoices(keys);
dropdownElem.setChoiceRenderer(new IChoiceRenderer<String>() {
private static final long serialVersionUID = -6265603675261014912L;
@Override
public Object getDisplayValue(final String value) {
return namesMap.get(value) == null ? value : namesMap.get(value);
}
@Override
public String getIdValue(final String value, final int i) {
return value;
}
@Override
public String getObject(final String id, final IModel<? extends List<? extends String>> choices) {
return id;
}
});
dropdownElem.setNullValid(true);
dropdownElem.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = -1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
List<T> elemsToCompare = new ArrayList<>();
elemsToCompare.add(selectedHistoryConfTO);
final String selectedKey = dropdownElem.getModelObject();
if (selectedKey != null) {
if (!selectedKey.isEmpty()) {
T confToCompare = availableHistoryConfTOs.stream().filter(object -> object.getKey().equals(selectedKey)).findAny().orElse(null);
elemsToCompare.add(confToCompare);
showConfigurationDiffPanel(elemsToCompare);
} else {
showConfigurationSinglePanel();
}
}
target.add(jsonPanel);
}
});
form.add(dropdownElem);
return form;
}
use of org.apache.wicket.model.CompoundPropertyModel in project syncope by apache.
the class UserDirectoryPanel method getActions.
@Override
public ActionsPanel<UserTO> getActions(final IModel<UserTO> model) {
final ActionsPanel<UserTO> panel = super.getActions(model);
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
send(UserDirectoryPanel.this, Broadcast.EXACT, new AjaxWizard.EditItemActionEvent<>(new UserWrapper(new UserRestClient().read(model.getObject().getKey())), target));
}
}, ActionType.EDIT, StringUtils.join(new String[] { StandardEntitlement.USER_READ, StandardEntitlement.USER_UPDATE }, ",")).setRealm(realm);
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
UserTO clone = SerializationUtils.clone(model.getObject());
clone.setKey(null);
clone.setUsername(model.getObject().getUsername() + "_clone");
send(UserDirectoryPanel.this, Broadcast.EXACT, new AjaxWizard.NewItemActionEvent<>(new UserWrapper(clone), target));
}
@Override
protected boolean statusCondition(final UserTO modelObject) {
return addAjaxLink.isVisibleInHierarchy() && realm.startsWith(SyncopeConstants.ROOT_REALM);
}
}, ActionType.CLONE, StandardEntitlement.USER_CREATE).setRealm(realm);
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
try {
UserRestClient.class.cast(restClient).mustChangePassword(model.getObject().getETagValue(), !model.getObject().isMustChangePassword(), model.getObject().getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (Exception e) {
LOG.error("While actioning object {}", model.getObject().getKey(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}, ActionType.MUSTCHANGEPASSWORD, StandardEntitlement.USER_UPDATE).setRealm(realm);
if (wizardInModal) {
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -4875218360625971340L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
IModel<AnyWrapper<UserTO>> formModel = new CompoundPropertyModel<>(new AnyWrapper<>(model.getObject()));
displayAttributeModal.setFormModel(formModel);
target.add(displayAttributeModal.setContent(new ChangePasswordModal(displayAttributeModal, pageRef, new UserWrapper(model.getObject()))));
displayAttributeModal.header(new Model<>(getString("any.edit", new Model<>(new AnyWrapper<>(model.getObject())))));
displayAttributeModal.show(true);
}
}, ActionType.PASSWORD_MANAGEMENT, StandardEntitlement.USER_UPDATE).setRealm(realm);
if (SyncopeConsoleSession.get().getPlatformInfo().isPwdResetAllowed() && !SyncopeConsoleSession.get().getPlatformInfo().isPwdResetRequiringSecurityQuestions()) {
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
try {
SyncopeConsoleSession.get().getAnonymousClient().getService(UserSelfService.class).requestPasswordReset(model.getObject().getUsername(), null);
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (Exception e) {
LOG.error("While actioning object {}", model.getObject().getKey(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}, ActionType.REQUEST_PASSWORD_RESET, StandardEntitlement.USER_UPDATE).setRealm(realm);
}
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
IModel<AnyWrapper<UserTO>> formModel = new CompoundPropertyModel<>(new AnyWrapper<>(model.getObject()));
altDefaultModal.setFormModel(formModel);
target.add(altDefaultModal.setContent(new AnyStatusModal<>(altDefaultModal, pageRef, formModel.getObject().getInnerObject(), "resource", true)));
altDefaultModal.header(new Model<>(getString("any.edit", new Model<>(new AnyWrapper<>(model.getObject())))));
altDefaultModal.show(true);
}
}, ActionType.ENABLE, StandardEntitlement.USER_UPDATE).setRealm(realm);
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
IModel<AnyWrapper<UserTO>> formModel = new CompoundPropertyModel<>(new AnyWrapper<>(model.getObject()));
altDefaultModal.setFormModel(formModel);
target.add(altDefaultModal.setContent(new AnyStatusModal<>(altDefaultModal, pageRef, formModel.getObject().getInnerObject(), "resource", false)));
altDefaultModal.header(new Model<>(getString("any.edit", new Model<>(new AnyWrapper<>(model.getObject())))));
altDefaultModal.show(true);
}
}, ActionType.MANAGE_RESOURCES, StandardEntitlement.USER_UPDATE).setRealm(realm);
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
target.add(utilityModal.setContent(new AnyPropagationTasks(utilityModal, AnyTypeKind.USER, model.getObject().getKey(), pageRef)));
utilityModal.header(new StringResourceModel("any.propagation.tasks", model));
utilityModal.show(true);
}
}, ActionType.PROPAGATION_TASKS, StandardEntitlement.TASK_LIST);
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
target.add(utilityModal.setContent(new NotificationTasks(AnyTypeKind.USER, model.getObject().getKey(), pageRef)));
utilityModal.header(new StringResourceModel("any.notification.tasks", model));
utilityModal.show(true);
target.add(utilityModal);
}
}, ActionType.NOTIFICATION_TASKS, StandardEntitlement.TASK_LIST);
}
panel.add(new ActionLink<UserTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
try {
restClient.delete(model.getObject().getETagValue(), model.getObject().getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (Exception e) {
LOG.error("While deleting object {}", model.getObject().getKey(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
@Override
protected boolean statusCondition(final UserTO modelObject) {
return realm.startsWith(SyncopeConstants.ROOT_REALM);
}
}, ActionType.DELETE, StandardEntitlement.USER_DELETE, true).setRealm(realm);
return panel;
}
use of org.apache.wicket.model.CompoundPropertyModel in project syncope by apache.
the class RemediationDirectoryPanel method getActions.
@Override
protected ActionsPanel<RemediationTO> getActions(final IModel<RemediationTO> model) {
ActionsPanel<RemediationTO> panel = super.getActions(model);
panel.add(new ActionLink<RemediationTO>() {
private static final long serialVersionUID = 6193210574968203299L;
@Override
public void onClick(final AjaxRequestTarget target, final RemediationTO ignore) {
modal.header(new ResourceModel("error"));
modal.setContent(new ExecMessageModal(model.getObject().getError()));
modal.show(true);
target.add(modal);
}
}, ActionLink.ActionType.VIEW_DETAILS, StandardEntitlement.REMEDIATION_READ);
if (model.getObject().getOperation() == ResourceOperation.DELETE) {
String entitlements = StringUtils.join(new String[] { StandardEntitlement.REMEDIATION_REMEDY, AnyTypeKind.USER.name().equals(model.getObject().getAnyType()) ? StandardEntitlement.USER_DELETE : AnyTypeKind.GROUP.name().equals(model.getObject().getAnyType()) ? StandardEntitlement.GROUP_DELETE : AnyEntitlement.DELETE.getFor(model.getObject().getAnyType()) }, ",");
panel.add(new ActionLink<RemediationTO>() {
private static final long serialVersionUID = 6193210574968203299L;
@Override
public void onClick(final AjaxRequestTarget target, final RemediationTO ignore) {
try {
restClient.remedy(model.getObject().getKey(), model.getObject().getKeyPayload());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (SyncopeClientException e) {
LOG.error("While performing remediation {}", model.getObject().getKey(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}, ActionLink.ActionType.CLOSE, entitlements, true);
} else {
String entitlements = model.getObject().getOperation() == ResourceOperation.CREATE ? StringUtils.join(new String[] { StandardEntitlement.REMEDIATION_REMEDY, AnyTypeKind.USER.name().equals(model.getObject().getAnyType()) ? StandardEntitlement.USER_CREATE : AnyTypeKind.GROUP.name().equals(model.getObject().getAnyType()) ? StandardEntitlement.GROUP_CREATE : AnyEntitlement.CREATE.getFor(model.getObject().getAnyType()) }, ",") : StringUtils.join(new String[] { StandardEntitlement.REMEDIATION_REMEDY, AnyTypeKind.USER.name().equals(model.getObject().getAnyType()) ? StandardEntitlement.USER_UPDATE : AnyTypeKind.GROUP.name().equals(model.getObject().getAnyType()) ? StandardEntitlement.GROUP_UPDATE : AnyEntitlement.UPDATE.getFor(model.getObject().getAnyType()) }, ",");
panel.add(new ActionLink<RemediationTO>() {
private static final long serialVersionUID = 6193210574968203299L;
@Override
public void onClick(final AjaxRequestTarget target, final RemediationTO ignore) {
modal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
RemediationTO remediationTO = model.getObject();
switch(remediationTO.getAnyType()) {
case "USER":
UserTO newUserTO;
UserTO previousUserTO;
if (remediationTO.getAnyPatchPayload() == null) {
newUserTO = (UserTO) remediationTO.getAnyTOPayload();
previousUserTO = null;
} else {
previousUserTO = new UserRestClient().read(remediationTO.getAnyPatchPayload().getKey());
newUserTO = AnyOperations.patch(previousUserTO, (UserPatch) remediationTO.getAnyPatchPayload());
}
AjaxWizard.EditItemActionEvent<UserTO> userEvent = new AjaxWizard.EditItemActionEvent<>(newUserTO, target);
userEvent.forceModalPanel(new RemediationUserWizardBuilder(model.getObject(), previousUserTO, newUserTO, new AnyTypeRestClient().read(remediationTO.getAnyType()).getClasses(), FormLayoutInfoUtils.fetch(Arrays.asList(remediationTO.getAnyType())).getLeft(), pageRef).build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT));
send(RemediationDirectoryPanel.this, Broadcast.EXACT, userEvent);
break;
case "GROUP":
GroupTO newGroupTO;
GroupTO previousGroupTO;
if (remediationTO.getAnyPatchPayload() == null) {
newGroupTO = (GroupTO) remediationTO.getAnyTOPayload();
previousGroupTO = null;
} else {
previousGroupTO = new GroupRestClient().read(remediationTO.getAnyPatchPayload().getKey());
newGroupTO = AnyOperations.patch(previousGroupTO, (GroupPatch) remediationTO.getAnyPatchPayload());
}
AjaxWizard.EditItemActionEvent<GroupTO> groupEvent = new AjaxWizard.EditItemActionEvent<>(newGroupTO, target);
groupEvent.forceModalPanel(new RemediationGroupWizardBuilder(model.getObject(), previousGroupTO, newGroupTO, new AnyTypeRestClient().read(remediationTO.getAnyType()).getClasses(), FormLayoutInfoUtils.fetch(Arrays.asList(remediationTO.getAnyType())).getMiddle(), pageRef).build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT));
send(RemediationDirectoryPanel.this, Broadcast.EXACT, groupEvent);
break;
default:
AnyObjectTO newAnyObjectTO;
AnyObjectTO previousAnyObjectTO;
if (remediationTO.getAnyPatchPayload() == null) {
newAnyObjectTO = (AnyObjectTO) remediationTO.getAnyTOPayload();
previousAnyObjectTO = null;
} else {
previousAnyObjectTO = new AnyObjectRestClient().read(remediationTO.getAnyPatchPayload().getKey());
newAnyObjectTO = AnyOperations.patch(previousAnyObjectTO, (AnyObjectPatch) remediationTO.getAnyPatchPayload());
}
AjaxWizard.EditItemActionEvent<AnyObjectTO> anyObjectEvent = new AjaxWizard.EditItemActionEvent<>(newAnyObjectTO, target);
anyObjectEvent.forceModalPanel(new RemediationAnyObjectWizardBuilder(model.getObject(), previousAnyObjectTO, newAnyObjectTO, new AnyTypeRestClient().read(remediationTO.getAnyType()).getClasses(), FormLayoutInfoUtils.fetch(Arrays.asList(remediationTO.getAnyType())).getRight().values().iterator().next(), pageRef).build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT));
send(RemediationDirectoryPanel.this, Broadcast.EXACT, anyObjectEvent);
}
}
}, ActionLink.ActionType.EDIT, entitlements);
}
panel.add(new ActionLink<RemediationTO>() {
private static final long serialVersionUID = 6193210574968203299L;
@Override
public void onClick(final AjaxRequestTarget target, final RemediationTO ignore) {
try {
restClient.delete(model.getObject().getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (SyncopeClientException e) {
LOG.error("While deleting {}", model.getObject().getKey(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}, ActionLink.ActionType.DELETE, StandardEntitlement.REMEDIATION_DELETE, true);
return panel;
}
use of org.apache.wicket.model.CompoundPropertyModel in project oc-explorer by devgateway.
the class ListViewSectionPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
setOutputMarkupId(true);
setOutputMarkupPlaceholderTag(true);
listWrapper = new TransparentWebMarkupContainer("listWrapper");
listWrapper.setOutputMarkupId(true);
add(listWrapper);
listWrapper.add(new Label("panelTitle", title));
listView = new ListView<T>("list", getModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<T> item) {
// we wrap the item model on a compound model so we can use the field ids as property models
final CompoundPropertyModel<T> compoundPropertyModel = new CompoundPropertyModel<>(item.getModel());
// we set back the model as the compound model, thus ensures the rest of the items added will benefit
item.setModel(compoundPropertyModel);
// we add the rest of the items in the listItem
populateCompoundListItem(item);
// we add the remove button
final BootstrapDeleteButton removeButton = getRemoveChildButton(item.getIndex());
item.add(removeButton);
}
};
listView.setReuseItems(true);
listView.setOutputMarkupId(true);
listWrapper.add(listView);
final BootstrapAddButton addButton = getAddNewChildButton();
add(addButton);
}
use of org.apache.wicket.model.CompoundPropertyModel in project openmeetings by apache.
the class CalendarPanel method onInitialize.
@Override
protected void onInitialize() {
final Form<Date> form = new Form<>("form");
add(form);
dialog = new AppointmentDialog("appointment", this, new CompoundPropertyModel<>(getDefault()));
add(dialog);
boolean isRtl = isRtl();
Options options = new Options();
options.set("isRTL", isRtl);
options.set("header", isRtl ? "{left: 'agendaDay,agendaWeek,month', center: 'title', right: 'today nextYear,next,prev,prevYear'}" : "{left: 'prevYear,prev,next,nextYear today', center: 'title', right: 'month,agendaWeek,agendaDay'}");
options.set("allDaySlot", false);
options.set("axisFormat", Options.asString("H(:mm)"));
options.set("defaultEventMinutes", 60);
options.set("timeFormat", Options.asString("H(:mm)"));
options.set("buttonText", new JSONObject().put("month", getString("801")).put("week", getString("800")).put("day", getString("799")).put("today", getString("1555")).toString());
JSONArray monthes = new JSONArray();
JSONArray shortMonthes = new JSONArray();
JSONArray days = new JSONArray();
JSONArray shortDays = new JSONArray();
// first week day must be Sunday
days.put(0, getString("466"));
shortDays.put(0, getString("459"));
for (int i = 0; i < 12; i++) {
monthes.put(i, getString(String.valueOf(469 + i)));
shortMonthes.put(i, getString(String.valueOf(1556 + i)));
if (i + 1 < 7) {
days.put(i + 1, getString(String.valueOf(460 + i)));
shortDays.put(i + 1, getString(String.valueOf(453 + i)));
}
}
options.set("monthNames", monthes.toString());
options.set("monthNamesShort", shortMonthes.toString());
options.set("dayNames", days.toString());
options.set("dayNamesShort", shortDays.toString());
options.set("firstDay", cfgDao.getInt(CONFIG_CALENDAR_FIRST_DAY, 0));
calendar = new Calendar("calendar", new AppointmentModel(), options) {
private static final long serialVersionUID = 1L;
@Override
protected void onInitialize() {
super.onInitialize();
add(new CalendarFunctionsBehavior(getMarkupId()));
}
@Override
public boolean isSelectable() {
return true;
}
@Override
public boolean isDayClickEnabled() {
return true;
}
@Override
public boolean isEventClickEnabled() {
return true;
}
@Override
public boolean isEventDropEnabled() {
return true;
}
@Override
public boolean isEventResizeEnabled() {
return true;
}
// no need to override onDayClick
@Override
public void onSelect(AjaxRequestTarget target, CalendarView view, LocalDateTime start, LocalDateTime end, boolean allDay) {
Appointment a = getDefault();
LocalDateTime s = start, e = end;
if (CalendarView.month == view) {
LocalDateTime now = ZonedDateTime.now(getZoneId()).toLocalDateTime();
s = start.withHour(now.getHour()).withMinute(now.getMinute());
e = s.plus(1, ChronoUnit.HOURS);
}
a.setStart(getDate(s));
a.setEnd(getDate(e));
dialog.setModelObjectWithAjaxTarget(a, target);
dialog.open(target);
}
@Override
public void onEventClick(AjaxRequestTarget target, CalendarView view, int eventId) {
Appointment a = apptDao.get((long) eventId);
dialog.setModelObjectWithAjaxTarget(a, target);
dialog.open(target);
}
@Override
public void onEventDrop(AjaxRequestTarget target, int eventId, long delta, boolean allDay) {
Appointment a = apptDao.get((long) eventId);
if (!AppointmentDialog.isOwner(a)) {
return;
}
java.util.Calendar cal = WebSession.getCalendar();
cal.setTime(a.getStart());
cal.add(java.util.Calendar.MILLISECOND, (int) delta);
a.setStart(cal.getTime());
cal.setTime(a.getEnd());
cal.add(java.util.Calendar.MILLISECOND, (int) delta);
a.setEnd(cal.getTime());
apptDao.update(a, getUserId());
if (a.getCalendar() != null) {
updatedeleteAppointment(target, CalendarDialog.DIALOG_TYPE.UPDATE_APPOINTMENT, a);
}
}
@Override
public void onEventResize(AjaxRequestTarget target, int eventId, long delta) {
Appointment a = apptDao.get((long) eventId);
if (!AppointmentDialog.isOwner(a)) {
return;
}
java.util.Calendar cal = WebSession.getCalendar();
cal.setTime(a.getEnd());
cal.add(java.util.Calendar.MILLISECOND, (int) delta);
a.setEnd(cal.getTime());
apptDao.update(a, getUserId());
if (a.getCalendar() != null) {
updatedeleteAppointment(target, CalendarDialog.DIALOG_TYPE.UPDATE_APPOINTMENT, a);
}
}
};
form.add(calendar);
populateGoogleCalendars();
add(refreshTimer);
add(syncTimer);
calendarDialog = new CalendarDialog("calendarDialog", this, new CompoundPropertyModel<>(getDefaultCalendar()));
add(calendarDialog);
calendarListContainer.setOutputMarkupId(true);
calendarListContainer.add(new ListView<OmCalendar>("items", new LoadableDetachableModel<List<OmCalendar>>() {
private static final long serialVersionUID = 1L;
@Override
protected List<OmCalendar> load() {
List<OmCalendar> cals = new ArrayList<>(apptManager.getCalendars(getUserId()));
cals.addAll(apptManager.getGoogleCalendars(getUserId()));
return cals;
}
}) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<OmCalendar> item) {
item.setOutputMarkupId(true);
final OmCalendar cal = item.getModelObject();
item.add(new Button("item", new PropertyModel<String>(cal, "title")).add(new AjaxEventBehavior(EVT_CLICK) {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
calendarDialog.open(target, CalendarDialog.DIALOG_TYPE.UPDATE_CALENDAR, cal);
target.add(calendarDialog);
}
}));
}
});
add(new Button("syncCalendarButton").add(new AjaxEventBehavior(EVT_CLICK) {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
syncCalendar(target);
}
}));
add(new Button("submitCalendar").add(new AjaxEventBehavior(EVT_CLICK) {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
calendarDialog.open(target, CalendarDialog.DIALOG_TYPE.UPDATE_CALENDAR, getDefaultCalendar());
target.add(calendarDialog);
}
}));
add(calendarListContainer);
super.onInitialize();
}
Aggregations