List of usage examples for org.apache.wicket.feedback ContainerFeedbackMessageFilter ContainerFeedbackMessageFilter
public ContainerFeedbackMessageFilter(MarkupContainer container)
From source file:almira.sample.web.IndexPage.java
License:Apache License
/** * Constructor./* ww w .j a va 2 s . c om*/ */ public IndexPage() { super(); final Catapult catapult = new Catapult(); final CompoundPropertyModel<Catapult> model = new CompoundPropertyModel<Catapult>(catapult); CATAPULT_CREATION_FORM.setModel(model); add(CATAPULT_CREATION_FORM); // add feedback panel to display any feedback messages for this form add(new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(CATAPULT_CREATION_FORM))); }
From source file:com.cubeia.backoffice.web.wallet.EditCurrencies.java
License:Open Source License
/** * Constructor that is invoked when page is invoked without a session. * */// w w w . j ava 2 s .c om @SuppressWarnings("serial") public EditCurrencies() { add(new FeedbackPanel("feedback", new ComponentFeedbackMessageFilter(EditCurrencies.this))); IModel<List<Currency>> currencyModel = new LoadableDetachableModel<List<Currency>>() { @Override protected List<Currency> load() { CurrencyListResult supportedCurrencies = walletService.getSupportedCurrencies(); if (supportedCurrencies == null) { return Collections.<Currency>emptyList(); } ArrayList<Currency> curs = new ArrayList<Currency>(supportedCurrencies.getCurrencies()); log.debug("got currencies: {}", curs); Collections.sort(curs, new Comparator<Currency>() { @Override public int compare(Currency o1, Currency o2) { return o1.getCode().compareTo(o2.getCode()); } }); return curs; } }; add(new ListView<Currency>("currencies", currencyModel) { @Override protected void populateItem(ListItem<Currency> item) { final Currency c = item.getModelObject(); item.add(new Label("code", Model.of(c.getCode()))); item.add(new Label("digits", Model.of(c.getFractionalDigits()))); item.add(new Link<String>("removeLink") { @Override public void onClick() { log.debug("removing currency: {}", c); walletService.removeCurrency(c.getCode()); } }.add(new ConfirmOnclickAttributeModifier("Really remove this currency?"))); } }); final CompoundPropertyModel<Currency> newCurrencyModel = new CompoundPropertyModel<Currency>( new Currency(null, 2)); Form<Currency> addForm = new Form<Currency>("addForm", newCurrencyModel) { @Override protected void onSubmit() { Currency cur = getModelObject(); log.debug("submit: {}", cur); try { walletService.addCurrency(cur); } catch (Exception e) { error("Error creating currency: " + e.getMessage()); return; } info("Added currency " + cur.getCode() + " with " + cur.getFractionalDigits() + " fractional digits"); newCurrencyModel.setObject(new Currency(null, 2)); } }; addForm.add(new RequiredTextField<String>("code", newCurrencyModel.<String>bind("code")) .add(StringValidator.exactLength(3))); addForm.add(new RequiredTextField<Integer>("digits", newCurrencyModel.<Integer>bind("fractionalDigits")) .add(new RangeValidator<Integer>(0, 8))); addForm.add(new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(addForm))); addForm.add(new WebMarkupContainer("submitButton") .add(new ConfirmOnclickAttributeModifier("Are you sure you want to add this currency?"))); add(addForm); }
From source file:com.cubeia.games.poker.admin.wicket.pages.wallet.EditCurrencies.java
License:Open Source License
/** * Constructor that is invoked when page is invoked without a session. * *///w w w . j a va 2 s.c o m @SuppressWarnings("serial") public EditCurrencies(PageParameters parameters) { super(parameters); add(new FeedbackPanel("feedback", new ComponentFeedbackMessageFilter(EditCurrencies.this))); IModel<List<Currency>> currencyModel = new LoadableDetachableModel<List<Currency>>() { @Override protected List<Currency> load() { CurrencyListResult supportedCurrencies = walletService.getSupportedCurrencies(); if (supportedCurrencies == null) { return Collections.<Currency>emptyList(); } ArrayList<Currency> curs = new ArrayList<Currency>(supportedCurrencies.getCurrencies()); log.debug("got currencies: {}", curs); Collections.sort(curs, new Comparator<Currency>() { @Override public int compare(Currency o1, Currency o2) { return o1.getCode().compareTo(o2.getCode()); } }); return curs; } }; add(new ListView<Currency>("currencies", currencyModel) { @Override protected void populateItem(ListItem<Currency> item) { final Currency c = item.getModelObject(); item.add(new Label("code", Model.of(c.getCode()))); item.add(new Label("digits", Model.of(c.getFractionalDigits()))); item.add(new Link<String>("removeLink") { @Override public void onClick() { log.debug("removing currency: {}", c); walletService.removeCurrency(c.getCode()); } }.add(new ConfirmOnclickAttributeModifier("Really remove this currency?"))); } }); final CompoundPropertyModel<Currency> newCurrencyModel = new CompoundPropertyModel<Currency>( new Currency(null, 2)); Form<Currency> addForm = new Form<Currency>("addForm", newCurrencyModel) { @Override protected void onSubmit() { Currency cur = getModelObject(); log.debug("submit: {}", cur); try { walletService.addCurrency(cur); } catch (Exception e) { error("Error creating currency: " + e.getMessage()); return; } info("Added currency " + cur.getCode() + " with " + cur.getFractionalDigits() + " fractional digits"); newCurrencyModel.setObject(new Currency(null, 2)); } }; addForm.add(new RequiredTextField<String>("code", newCurrencyModel.<String>bind("code")) .add(StringValidator.exactLength(3))); addForm.add(new RequiredTextField<Integer>("digits", newCurrencyModel.<Integer>bind("fractionalDigits")) .add(new RangeValidator<Integer>(0, 8))); addForm.add(new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(addForm))); addForm.add(new WebMarkupContainer("submitButton") .add(new ConfirmOnclickAttributeModifier("Are you sure you want to add this currency?"))); add(addForm); }
From source file:com.evolveum.midpoint.web.page.login.PageSelfRegistration.java
License:Apache License
@Override protected WebMarkupContainer initStaticLayout() { // feedback/*from w w w . jav a 2 s. c o m*/ // final Form<?> mainForm = new Form<>(ID_MAIN_FORM); WebMarkupContainer staticRegistrationForm = createMarkupContainer(ID_STATIC_FORM, null); addMultilineLable(ID_WELCOME, "PageSelfRegistration.welcome.message", staticRegistrationForm); addMultilineLable(ID_ADDITIONAL_TEXT, "PageSelfRegistration.additional.message", staticRegistrationForm); FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ContainerFeedbackMessageFilter(PageSelfRegistration.this)); feedback.setOutputMarkupId(true); add(feedback); TextPanel<String> firstName = new TextPanel<>(ID_FIRST_NAME, new PropertyModel<String>(getUserModel(), UserType.F_GIVEN_NAME.getLocalPart() + ".orig") { private static final long serialVersionUID = 1L; @Override public void setObject(String object) { getUserModel().getObject().setGivenName(new PolyStringType(object)); } }); initInputProperties(feedback, firstName); staticRegistrationForm.add(firstName); TextPanel<String> lastName = new TextPanel<>(ID_LAST_NAME, new PropertyModel<String>(getUserModel(), UserType.F_FAMILY_NAME.getLocalPart() + ".orig") { private static final long serialVersionUID = 1L; @Override public void setObject(String object) { getUserModel().getObject().setFamilyName(new PolyStringType(object)); } }); initInputProperties(feedback, lastName); staticRegistrationForm.add(lastName); TextPanel<String> email = new TextPanel<>(ID_EMAIL, new PropertyModel<>(getUserModel(), UserType.F_EMAIL_ADDRESS.getLocalPart())); initInputProperties(feedback, email); staticRegistrationForm.add(email); createPasswordPanel(staticRegistrationForm); return staticRegistrationForm; }
From source file:com.evolveum.midpoint.web.page.login.PageSelfRegistration.java
License:Apache License
private void initInputProperties(FeedbackPanel feedback, TextPanel<String> input) { input.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour()); input.getBaseFormComponent().setRequired(true); feedback.setFilter(new ContainerFeedbackMessageFilter(input.getBaseFormComponent())); input.add(new VisibleEnableBehaviour() { private static final long serialVersionUID = 1L; @Override//from w w w .j a v a 2s. c o m public boolean isEnabled() { return getOidFromParams(getPageParameters()) == null; } }); }
From source file:com.francetelecom.clara.cloud.presentation.admin.AdminHomePage.java
License:Apache License
private void initComponents() { NavigationMenuFirstLevel navFirstLvl = new NavigationMenuFirstLevel(); add(navFirstLvl);/*from w w w. j a v a 2 s . c o m*/ /* set head page title to display in browser title bar */ add(new Label("head_page_title", getString("portal.design.web.title.homepage"))); List<BreadcrumbsItem> breadcrumbsItems = new ArrayList<BreadcrumbsItem>(); breadcrumbsItems .add(new BreadcrumbsItem(this.getClass(), "portal.design.breadcrumbs.homepage", null, true)); Breadcrumbs breadcrumbs = new Breadcrumbs("breadcrumbs", breadcrumbsItems); add(breadcrumbs); feedback = new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(this)); feedback.setOutputMarkupId(true); add(feedback); add(new ManageStatsForm("manageStatsForm")); StatsTablePanel statsTablePanel = new StatsTablePanel("statsTablePanel"); add(statsTablePanel); }
From source file:com.francetelecom.clara.cloud.presentation.designer.panels.DesignerArchitectureMatrixPanel.java
License:Apache License
private void initComponents() { matrixFeedback = new FeedbackPanel("matrixFeedback", new ContainerFeedbackMessageFilter(this)); matrixFeedback.setOutputMarkupId(true); add(matrixFeedback);//from w ww .ja v a 2 s.c o m matrixContainer = new WebMarkupContainer("matrixContainer"); /* ListView - first level */ matrixContent = new ListView<List<LogicalModelItem>>("listRows", getImprovedList()) { private static final long serialVersionUID = -6363917228846486149L; @Override protected void populateItem(final ListItem<List<LogicalModelItem>> listItem) { /* ListView - secondLevel */ listItem.add(new ListView<LogicalModelItem>("listCols", listItem.getModelObject()) { private static final long serialVersionUID = -4827251147718587694L; @Override protected void populateItem(ListItem<LogicalModelItem> logicalServiceListItem) { int rowIndex = listItem.getIndex(); int colIndex = logicalServiceListItem.getIndex(); CellType type = getCellTypeAt(rowIndex, colIndex); final LogicalService service = rowIndex > 0 ? rowHeaders.get(rowIndex - 1) : null; final ProcessingNode node = colIndex > 0 ? colHeaders.get(colIndex - 1) : null; String cellBackGroundColor = "externalSrvBckGrd"; if (service != null) { if (service.getClass().getAnnotation(GuiClassMapping.class).isExternal()) { cellBackGroundColor = "externalSrvBckGrd"; } else { cellBackGroundColor = "internalSrvBckGrd"; } } /* Population of the item depends on the type of the cell */ switch (type) { case CORNER: /* top left corner */ logicalServiceListItem.add(new AttributeModifier("class", "cornerCell")); logicalServiceListItem.add(new Label("content", " ")); logicalServiceListItem.setVisible(!colHeaders.isEmpty() || !rowHeaders.isEmpty()); break; case HEADER_COL: /* first cell of the col */ DesignerArchitectureMatrixCellButtonPanel headerColCellPanel = new DesignerArchitectureMatrixCellButtonPanel( "content", logicalServiceListItem.getModel(), envDetailsDto, readOnly, allowOverride) { private static final long serialVersionUID = 7989553592786367825L; @Override protected void onClickDelete(AjaxRequestTarget target) { if (parentPage instanceof DesignerPage) { ((DesignerPage) parentPage).removeLogicalService(node, target, DesignerArchitectureMatrixPanel.this); } } @Override protected void onClickEdit(AjaxRequestTarget target) { if (parentPage instanceof DesignerPage) { step = ((DesignerPage) parentPage).getLogicalServicesHelper() .isLogicalServiceExternal(node) ? 0 : 1; ((DesignerPage) parentPage).managePageComponents(target, step, node); } } @Override protected void onClickView(AjaxRequestTarget target) { parentPage.openModalWindow(target, node, false); } @Override protected void onClickWspInfo(AjaxRequestTarget target) { // Can never happen on a JeeProcessing } @Override protected void onClickConfigOverride(AjaxRequestTarget target) { // Can not happen for now on a JeeProcessing } }; logicalServiceListItem.add(new AttributeModifier("class", "hColCell")); logicalServiceListItem .add(new AttributeAppender("class", new Model<>("logicalService"), " ")); // add default ProcessingNode icon String className = ProcessingNode.class.getSimpleName(); if (logicalServiceListItem.getModelObject() instanceof JeeProcessing) { className = JeeProcessing.class.getSimpleName(); } else if (logicalServiceListItem.getModelObject() instanceof CFJavaProcessing) { className = CFJavaProcessing.class.getSimpleName(); } logicalServiceListItem .add(new AttributeAppender("class", new Model<>("Logical" + className), " ")); // if custom icon selected, display it if (logicalServiceListItem.getModel() != null && ((ProcessingNode) logicalServiceListItem.getModelObject()) .getIconUrl() != null && !((ProcessingNode) logicalServiceListItem.getModelObject()).getIconUrl() .equals("")) { logicalServiceListItem.add(new AttributeModifier("style", new Model<>("background-image:url(\"" + ((ProcessingNode) logicalServiceListItem.getModelObject()) .getIconUrl() + "\"); background-repeat:no-repeat; background-position:5px 5px; background-size:32px 32px;"))); } logicalServiceListItem.add(headerColCellPanel); break; case HEADER_ROW: /* first cell of the row */ DesignerArchitectureMatrixCellButtonPanel headerRowCellPanel = new DesignerArchitectureMatrixCellButtonPanel( "content", logicalServiceListItem.getModel(), envDetailsDto, readOnly, allowOverride) { private static final long serialVersionUID = -6883719251719480265L; @Override protected void onClickDelete(AjaxRequestTarget target) { if (parentPage instanceof DesignerPage) { ((DesignerPage) parentPage).removeLogicalService(service, target, DesignerArchitectureMatrixPanel.this); } } @Override protected void onClickEdit(AjaxRequestTarget target) { if (parentPage instanceof DesignerPage) { step = ((DesignerPage) parentPage).getLogicalServicesHelper() .isLogicalServiceExternal(service) ? 0 : 1; ((DesignerPage) parentPage).managePageComponents(target, step, service); } } @Override protected void onClickView(AjaxRequestTarget target) { parentPage.openModalWindow(target, service, false); } @Override protected void onClickWspInfo(AjaxRequestTarget target) { parentPage.openWspInfoPanel(target, (LogicalSoapService) service, envDetailsDto); } @Override protected void onClickConfigOverride(AjaxRequestTarget target) { parentPage.openModalWindow(target, service, true); } }; logicalServiceListItem.add(new AttributeModifier("class", cellBackGroundColor)); logicalServiceListItem .add(new AttributeAppender("class", new Model<>("hRowCell"), " ")); logicalServiceListItem .add(new AttributeAppender("class", new Model<>("logicalService"), " ")); logicalServiceListItem.add(new AttributeAppender("class", new Model<>(service.getClass().getSimpleName()), " ")); logicalServiceListItem.add(headerRowCellPanel); break; case DATA: final DesignerArchitectureMatrixCellDataPanel dataPanel = getPanelFor(service, node); dataPanel.setEnabled(!readOnly); dataPanel.setOutputMarkupId(true); logicalServiceListItem.add(new AttributeModifier("class", cellBackGroundColor)); logicalServiceListItem.add(dataPanel); break; default: break; } } }); } }; matrixContent.setOutputMarkupId(true); matrixContainer.add(matrixContent); matrixContainer.setOutputMarkupId(true); add(matrixContainer); setOutputMarkupId(true); WebMarkupContainer matrixLegendContainer = new WebMarkupContainer("matrixLegendContainer") { private static final long serialVersionUID = 8725411660499502794L; @Override public boolean isVisible() { if (parentPage == null) return false; LogicalDeployment ld = parentPage.getLogicalDeployment(); if (ld == null) return false; return !(ld.listProcessingNodes().isEmpty() && ld.listLogicalServices().isEmpty()); } }; add(matrixLegendContainer); }
From source file:com.genericconf.bbbgateway.web.panels.JoinMeetingFormPanel.java
License:Apache License
public JoinMeetingFormPanel(String id, final IModel<Meeting> model) { super(id, model); setOutputMarkupId(true);/*ww w . ja va 2 s. c om*/ form = new Form<Void>("joinForm"); final FeedbackPanel fb = new JQueryFeedbackPanel("feedback", new ContainerFeedbackMessageFilter(form)); fb.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true); form.add(fb); final TextField<String> name = new TextField<String>("name", new PropertyModel<String>(this, "attendeeName")); form.add(name.setRequired(true).setOutputMarkupId(true)); if (AjaxRequestTarget.get() != null) { AjaxRequestTarget.get().focusComponent(name); } form.add(new AjaxButton("submit") { private static final long serialVersionUID = 1L; @SpringBean private IMeetingService meetingService; @Override protected void onError(AjaxRequestTarget target, Form<?> form) { super.onError(target, form); target.addComponent(fb); onAjaxRequest(target); } @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { final Attendee att = new Attendee(); att.setRole(Role.VIEWER); att.setName(attendeeName); meetingService.addToWaitingRoom(model.getObject(), att); setResponsePage(WaitingRoom.class, WaitingRoom.createPageParameters(model.getObject(), att)); } }); add(form); }
From source file:com.googlecode.wicket.jquery.ui.panel.JQueryFeedbackPanel.java
License:Apache License
/** * Constructor//from w w w .j ava2 s .c o m * @param id the markup id * @param filter the container that message reporters must be a child of */ public JQueryFeedbackPanel(String id, MarkupContainer filter) { super(id, new ContainerFeedbackMessageFilter(filter)); this.init(); }
From source file:com.googlecode.wicket.kendo.ui.panel.KendoFeedbackPanel.java
License:Apache License
/** * Constructor/*from w w w .j a va 2 s . c o m*/ * * @param id the markup id * @param container the container that message reporters must be a child of */ public KendoFeedbackPanel(String id, MarkupContainer container) { this(id, new ContainerFeedbackMessageFilter(container), new Options()); }