Source:
public ServiceLayerConfigurationPanel(String id, IModel<LayerInfo> layerModel) { super(id, layerModel); final AjaxCheckBox configEnabledCheck = new AjaxCheckBox( "configEnabled", new PropertyModel<Boolean>(layerModel, "resource.serviceConfiguration")) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { ServiceLayerConfigurationPanel.this .getServicesMultiSelector() .setVisible(getModelObject()); target.add(ServiceLayerConfigurationPanel.this.getPanel1()); } }; add(configEnabledCheck); PropertyModel<List<String>> dsModel = new PropertyModel<>(layerModel, "resource.disabledServices"); final IChoiceRenderer<String> renderer = new ChoiceRenderer<String>() { @Override public String getObject( String id, IModel<? extends List<? extends String>> choices) { return id; } @Override public Object getDisplayValue(String object) { if (object == null) return null; return super.getDisplayValue(object); } @Override public String getIdValue(String object, int index) { if (object == null) return null; return object; } }; servicesMultiSelector = new Palette<String>( "servicesSelection", dsModel, servicesVotedModel(layerModel.getObject().getResource()), renderer, 10, false) { private static final long serialVersionUID = 1L; @Override public Component newSelectedHeader(final String componentId) { return new Label( componentId, new ResourceModel("DisabledServicesPalette.selectedHeader")); } @Override public Component newAvailableHeader(final String componentId) { return new Label( componentId, new ResourceModel("DisabledServicesPalette.availableHeader")); } }; servicesMultiSelector.add(new DefaultTheme()); servicesMultiSelector.setVisible( layerModel.getObject().getResource().isServiceConfiguration()); panel1 = new WebMarkupContainer("panel1"); panel1.setOutputMarkupPlaceholderTag(true); add(panel1); panel1.add(servicesMultiSelector); }

Target:
public ServiceLayerConfigurationPanel(String id, IModel<LayerInfo> layerModel) { super(id, layerModel); final AjaxCheckBox configEnabledCheck = new AjaxCheckBox( "configEnabled", new PropertyModel<Boolean>(layerModel, "resource.serviceConfiguration")) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { ServiceLayerConfigurationPanel.this.servicesMultiSelector.setVisible( getModelObject()); target.add(ServiceLayerConfigurationPanel.this.serviceSelectionContainer); } }; add(configEnabledCheck); PropertyModel<List<String>> dsModel = new PropertyModel<>(layerModel, "resource.disabledServices"); final IChoiceRenderer<String> renderer = new ChoiceRenderer<String>() { @Override public String getObject( String id, IModel<? extends List<? extends String>> choices) { return id; } @Override public Object getDisplayValue(String object) { if (object == null) return null; return super.getDisplayValue(object); } @Override public String getIdValue(String object, int index) { return object; } }; servicesMultiSelector = new Palette<String>( "servicesSelection", dsModel, servicesVotedModel(layerModel.getObject().getResource()), renderer, 10, false) { private static final long serialVersionUID = 1L; @Override public Component newSelectedHeader(final String componentId) { return new Label( componentId, new ResourceModel("DisabledServicesPalette.selectedHeader")); } @Override public Component newAvailableHeader(final String componentId) { return new Label( componentId, new ResourceModel("DisabledServicesPalette.availableHeader")); } }; servicesMultiSelector.add(new DefaultTheme()); servicesMultiSelector.setVisible( layerModel.getObject().getResource().isServiceConfiguration()); serviceSelectionContainer = new WebMarkupContainer("serviceSelectionContainer"); serviceSelectionContainer.setOutputMarkupPlaceholderTag(true); add(serviceSelectionContainer); serviceSelectionContainer.add(servicesMultiSelector); }