if (!targetPanelInfo.getServiceClass().equals(serviceClass)) { it.remove(); } else if (!targetPanelInfo.getServiceConfigClass().equals(config.getClass())) { it.remove();
void updatePanel(SecurityNamedServicePanelInfo panelInfo, AjaxRequestTarget target) { //create a new config object T config = null; try { config = (T) panelInfo.getServiceConfigClass().newInstance(); } catch (Exception e) { throw new WicketRuntimeException( "Unable to create config class: " + panelInfo.getServiceConfigClass(), e); } config.setClassName(panelInfo.getServiceClass().getCanonicalName()); //update the form model form.setModel(new CompoundPropertyModel<T>(config)); //create the new panel panel = createPanel("content", panelInfo, new Model(config)); //remove the old panel if it is there if (panelContainer.get("content") != null) { panelContainer.remove("content"); } panelContainer.add(panel); if (target != null) { target.addComponent(panelContainer); } }
void updatePanel(SecurityNamedServicePanelInfo panelInfo, AjaxRequestTarget target) { // create a new config object T config = null; try { config = (T) panelInfo.getServiceConfigClass().newInstance(); } catch (Exception e) { throw new WicketRuntimeException( "Unable to create config class: " + panelInfo.getServiceConfigClass(), e); } config.setClassName(panelInfo.getServiceClass().getCanonicalName()); // update the form model form.setModel(new CompoundPropertyModel<T>(config)); // create the new panel panel = createPanel("content", panelInfo, new Model(config)); // remove the old panel if it is there if (panelContainer.get("content") != null) { panelContainer.remove("content"); } panelContainer.add(panel); if (target != null) { target.add(panelContainer); } }
void updatePanel(SecurityNamedServicePanelInfo panelInfo, AjaxRequestTarget target) { //create a new config object T config = null; try { config = (T) panelInfo.getServiceConfigClass().newInstance(); } catch (Exception e) { throw new WicketRuntimeException( "Unable to create config class: " + panelInfo.getServiceConfigClass(), e); } config.setClassName(panelInfo.getServiceClass().getCanonicalName()); //update the form model form.setModel(new CompoundPropertyModel<T>(config)); //create the new panel panel = createPanel("content", panelInfo, new Model(config)); //remove the old panel if it is there if (panelContainer.get("content") != null) { panelContainer.remove("content"); } panelContainer.add(panel); if (target != null) { target.addComponent(panelContainer); } }