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();
	}
public void onFinished(JavaScriptObject jso) {
		applFormItems.clear();
		applFormItems.addAll(JsonUtils.<ApplicationFormItemWithPrefilledValue>jsoAsList(jso));
		applFormGenerators.clear();
		if (applFormItems == null || applFormItems.isEmpty()) {
		
			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) {
		
			if (Location.getParameter("targetexisting") != null) {
				Location.replace(Location.getParameter("targetexisting"));
			}
		
			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 {
		
			prepareApplicationForm();
		}
		session.getUiElements().setLogText("Loading " + type + " application form items in selected VO finished:" + applFormItems.size());
		events.onFinished(jso);
		loaderImage.loadingFinished();
	}
public void onfinished(javascriptobject jso) { applformitems.clear(); applformitems.addall(jsonutils.<applicationformitemwithprefilledvalue>jsoaslist(jso)); applformgenerators.clear(); if (applformitems == null || applformitems.isempty()) { 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) { if (location.getparameter("targetexisting") != null) { location.replace(location.getparameter("targetexisting")); } 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 { prepareapplicationform(); } session.getuielements().setlogtext("loading " + type + " application form items in selected vo finished:" + applformitems.size()); events.onfinished(jso); loaderimage.loadingfinished(); }