@Override protected void onClick(AjaxRequestTarget target) { SecurityNamedServiceEditPage<T> editPage = new SecurityNamedServiceEditPage<T>(model); editPage.setReturnPage(getPage()); setResponsePage(editPage); } };
@Override public void onSubmit() { handleSubmit(getForm()); } });
@Override protected void onClick(AjaxLink<SecurityNamedServicePanelInfo> link, AjaxRequestTarget target) { updatePanel(link.getModelObject(), target); } };
public SecurityNamedServiceNewPage(Class<S> serviceClass) { add(new Label("title1", createTitleModel(serviceClass).getString())); add(new Label("title2", createTitleModel(serviceClass).getString())); List<SecurityNamedServicePanelInfo> panelInfos = lookupPanelInfos(serviceClass); add(new WebMarkupContainer("servicesContainer").add(serviceLinks).setOutputMarkupId(true)); add(form = new Form<T>("form")); updatePanel(panelInfos.get(0), null);
@Override protected void populateItem(ListItem<SecurityNamedServicePanelInfo> item) { SecurityNamedServicePanelInfo panelInfo = item.getModelObject(); item.add( newLink("link", item.getModel()) .add(new Label("title", createShortTitleModel(panelInfo))) .setEnabled(item.getIndex() > 0)); item.add(new Label("description", createDescriptionModel(panelInfo))); }
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); } }
public SecurityNamedServiceNewPage(Class<S> serviceClass) { add(new Label("title1", createTitleModel(serviceClass).getString())); add(new Label("title2", createTitleModel(serviceClass).getString())); List<SecurityNamedServicePanelInfo> panelInfos = lookupPanelInfos(serviceClass); add(new WebMarkupContainer("servicesContainer").add(serviceLinks).setOutputMarkupId(true)); add(form = new Form<T>("form")); updatePanel(panelInfos.get(0), null);
@Override protected void populateItem(ListItem<SecurityNamedServicePanelInfo> item) { SecurityNamedServicePanelInfo panelInfo = item.getModelObject(); item.add(newLink("link", item.getModel()).add( new Label("title", createShortTitleModel(panelInfo))).setEnabled(item.getIndex() > 0)); item.add(new Label("description", createDescriptionModel(panelInfo))); }
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); } }
public SecurityNamedServiceNewPage(Class<S> serviceClass) { add(new Label("title1", createTitleModel(serviceClass).getString())); add(new Label("title2", createTitleModel(serviceClass).getString())); List<SecurityNamedServicePanelInfo> panelInfos = lookupPanelInfos(serviceClass); add(new WebMarkupContainer("servicesContainer").add(serviceLinks).setOutputMarkupId(true)); add(form = new Form<T>("form")); updatePanel(panelInfos.get(0), null);
@Override protected void onClick(AjaxRequestTarget target) { SecurityNamedServiceEditPage<T> editPage = new SecurityNamedServiceEditPage<T>(model); editPage.setReturnPage(getPage()); setResponsePage(editPage); } };
@Override protected void populateItem(ListItem<SecurityNamedServicePanelInfo> item) { SecurityNamedServicePanelInfo panelInfo = item.getModelObject(); item.add(newLink("link", item.getModel()).add( new Label("title", createShortTitleModel(panelInfo))).setEnabled(item.getIndex() > 0)); item.add(new Label("description", createDescriptionModel(panelInfo))); }
@Override protected void onClick( AjaxLink<SecurityNamedServicePanelInfo> link, AjaxRequestTarget target) { updatePanel(link.getModelObject(), target); } };
@Override public void onSubmit() { handleSubmit(getForm()); } });
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); } }
@Override protected void onClick(AjaxRequestTarget target) { SecurityNamedServiceEditPage<T> editPage = new SecurityNamedServiceEditPage<T>(model); editPage.setReturnPage(getPage()); setResponsePage(editPage); } };
@Override protected void onClick(AjaxLink<SecurityNamedServicePanelInfo> link, AjaxRequestTarget target) { updatePanel(link.getModelObject(), target); } };
@Override public void onSubmit() { handleSubmit(getForm()); } });