/** * Create the galleryTypeSelector, only shown in the UI if there actually is something to choose from. Send changes * to the backend using Ajax, in order to remember old choices while navigating through the gallery. * * @return the type selector component */ @SuppressWarnings("unchecked") private Component createTypeSelector() { getGalleryType(); // initialize the galleryType value return new DropDownChoice<String>("gallery-type-selector", new PropertyModel(this, "galleryType"), galleryTypesModel, new TypeChoiceRenderer(this)) { @Override public boolean isVisible() { return getChoices().size() > 1; } } .setNullValid(false) .add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { // required because abstract, but all we need is to have galleryType set, which happens underwater. } }); }
}, implementationNames).setNullValid(false).add(new AjaxFormComponentUpdatingBehavior("change"){
.setNullValid(true).add(new RefreshMetaContextOnChangeBehaviour());
new LambdaChoiceRenderer<>(KnowledgeBase::getName)) .setNullValid(true) .add(new LambdaAjaxFormComponentUpdatingBehavior("change", target -> target.add(form.get(MID_SCOPE))))); form.add(
new LambdaChoiceRenderer<>(KnowledgeBase::getName)) .setNullValid(true) .add(new LambdaAjaxFormComponentUpdatingBehavior("change", target -> target.add(form.get(MID_SCOPE))))); form.add(