// FIXME - this is probably not good, since it prevents vo extension when targetexisting is specified.
public void onFinished(JavaScriptObject jso) {
		applFormItems.clear();
		applFormItems.addAll(JsonUtils.<ApplicationFormItemWithPrefilledValue>jsoAsList(jso));
		applFormGenerators.clear();
		if (applFormItems == null || applFormItems.isEmpty()) {
			// when there are no application form items
			FlexTable ft = new FlexTable();
			ft.setSize("100%", "300px");
			ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + ApplicationMessages.INSTANCE.noFormDefined());
			ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
			ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
			contents.setWidget(ft);
		} else if (PerunEntity.VIRTUAL_ORGANIZATION.equals(entity) && "EXTENSION".equalsIgnoreCase(type) && Location.getParameter("targetexisting") != null) {
			// FIXME - this is probably not good, since it prevents vo extension when targetexisting is specified.
			if (Location.getParameter("targetexisting") != null) {
				Location.replace(Location.getParameter("targetexisting"));
			}
			// when there are no application form items
			FlexTable ft = new FlexTable();
			ft.setSize("100%", "300px");
			ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + ApplicationMessages.INSTANCE.alreadyVoMember());
			ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
			ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
			contents.setWidget(ft);
		} else {
			// create application form
			prepareApplicationForm();
		}
		session.getUiElements().setLogText("Loading " + type + " application form items in selected VO finished:" + applFormItems.size());
		events.onFinished(jso);
		loaderImage.loadingFinished();
	}
contents.setWidget(ft);
} else if (PerunEntity.VIRTUAL_ORGANIZATION.equals(entity) && "EXTENSION".equalsIgnoreCase(type) && Location.getParameter("targetexisting") != null) {
// FIXME - this is probably not good, since it prevents vo extension when targetexisting is specified.
if (Location.getParameter("targetexisting") != null) {
Location.replace(Location.getParameter("targetexisting"));
applFormGenerators.clear();
if (applFormItems == null || applFormItems.isEmpty()) {
// when there are no application form items
FlexTable ft = new FlexTable();
ft.setSize("100%", "300px");
ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + ApplicationMessages.INSTANCE.noFormDefined());
ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
contents.setWidget(ft);
} else if (PerunEntity.VIRTUAL_ORGANIZATION.equals(entity) && "EXTENSION".equalsIgnoreCase(type) && Location.getParameter("targetexisting") != null) {
// FIXME - this is probably not good, since it prevents vo extension when targetexisting is specified.
if (Location.getParameter("targetexisting") != null) {
Location.replace(Location.getParameter("targetexisting"));
}
// when there are no application form items
FlexTable ft = new FlexTable();
ft.setSize("100%", "300px");
ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + ApplicationMessages.INSTANCE.alreadyVoMember());
ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
contents.setWidget(ft);
public void onFinished(JavaScriptObject jso) {
applFormItems.clear();
applFormItems.addAll(JsonUtils.<ApplicationFormItemWithPrefilledValue>jsoAsList(jso));
applFormGenerators.clear();
if (applFormItems == null || applFormItems.isEmpty()) {
// when there are no application form items
FlexTable ft = new FlexTable();
ft.setSize("100%", "300px");
ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + ApplicationMessages.INSTANCE.noFormDefined());
ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
contents.setWidget(ft);
} else if (PerunEntity.VIRTUAL_ORGANIZATION.equals(entity) && "EXTENSION".equalsIgnoreCase(type) && Location.getParameter("targetexisting") != null) {
// FIXME - this is probably not good, since it prevents vo extension when targetexisting is specified.
if (Location.getParameter("targetexisting") != null) {
Location.replace(Location.getParameter("targetexisting"));
}
// when there are no application form items
FlexTable ft = new FlexTable();
ft.setSize("100%", "300px");
ft.setHTML(0, 0, new Image(LargeIcons.INSTANCE.errorIcon()) + ApplicationMessages.INSTANCE.alreadyVoMember());
ft.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
ft.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
contents.setWidget(ft);
} else {
// create application form
prepareApplicationForm();
}
session.getUiElements().setLogText("Loading " + type + " application form items in selected VO finished:" + applFormItems.size());
events.onFinished(jso);
loaderImage.loadingFinished();
}