org.apache.wicket.markup.html.panel.FeedbackPanel Java Examples
The following examples show how to use
org.apache.wicket.markup.html.panel.FeedbackPanel.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RechnungCostEditTablePanel.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
/** * @param id */ @SuppressWarnings("serial") public RechnungCostEditTablePanel(final String id) { super(id); feedbackPanel = new FeedbackPanel("feedback"); ajaxComponents.register(feedbackPanel); add(feedbackPanel); this.form = new Form<AbstractRechnungsPositionDO>("form") { @Override protected void onSubmit() { super.onSubmit(); csrfTokenHandler.onSubmit(); } }; add(form); csrfTokenHandler = new CsrfTokenHandler(form); rows = new RepeatingView("rows"); form.add(rows); }
Example #2
Source File: DeleteAccountPage.java From yes-cart with Apache License 2.0 | 6 votes |
/** * Construct page. * * @param params page parameters */ public DeleteAccountPage(final PageParameters params) { super(params); add( new FeedbackPanel(FEEDBACK) ).add( new DeletePanel(AUTH_VIEW, params.get("token").toString()) ).add( new StandardFooter(FOOTER) ).add( new StandardHeader(HEADER) ).add( new ServerSideJs("serverSideJs") ).add( new HeaderMetaInclude("headerInclude") ); }
Example #3
Source File: RegistrationPage.java From yes-cart with Apache License 2.0 | 6 votes |
/** * Construct page. * * @param params page parameters */ public RegistrationPage(final PageParameters params) { super(params); add( new FeedbackPanel(FEEDBACK) ).add( new RegisterPanel(CART_VIEW, false) ).addOrReplace( new StandardFooter(FOOTER) ).addOrReplace( new StandardHeader(HEADER) ).addOrReplace( new ServerSideJs("serverSideJs") ).addOrReplace( new HeaderMetaInclude("headerInclude") ); }
Example #4
Source File: ContactPage.java From yes-cart with Apache License 2.0 | 6 votes |
/** * Construct contact information page. * @param params page parameters. */ public ContactPage(final PageParameters params) { super(params); add(new StandardFooter(FOOTER)); add(new StandardHeader(HEADER)); add(new ServerSideJs("serverSideJs")); add(new HeaderMetaInclude("headerInclude")); final AttrValueWithAttribute emailConfig = customerServiceFacade.getShopEmailAttribute(getCurrentShop()); final IValidator<String> emailValidator; if (emailConfig != null && StringUtils.isNotBlank(emailConfig.getAttribute().getRegexp())) { final String regexError = new FailoverStringI18NModel( emailConfig.getAttribute().getValidationFailedMessage(), emailConfig.getAttribute().getCode()).getValue(getLocale().getLanguage()); emailValidator = new CustomPatternValidator(emailConfig.getAttribute().getRegexp(), new Model<>(regexError)); } else { emailValidator = EmailAddressValidator.getInstance(); } add(new ContactForm("contactForm",emailValidator)); add(new FeedbackPanel("feedback")); }
Example #5
Source File: LoginPage.java From yes-cart with Apache License 2.0 | 6 votes |
/** * Construct page. * * @param params page parameters */ public LoginPage(final PageParameters params) { super(params); add( new FeedbackPanel(FEEDBACK) ).add( new LoginPanel(AUTH_VIEW, false) ).add( new StandardFooter(FOOTER) ).add( new StandardHeader(HEADER) ).add( new ServerSideJs("serverSideJs") ).add( new HeaderMetaInclude("headerInclude") ); }
Example #6
Source File: OrdersPage.java From yes-cart with Apache License 2.0 | 6 votes |
/** * Construct page. * * @param params page parameters */ public OrdersPage(final PageParameters params) { super(params); final String email = getCurrentCart().getCustomerEmail(); final Customer customer; if (StringUtils.isNotBlank(email)) { customer = customerServiceFacade.getCustomerByEmail(getCurrentShop(), email); } else { customer = null; // Redirect away from profile! final PageParameters logOutParams = new PageParameters(); logOutParams.set(ShoppingCartCommand.CMD_LOGOUT, ShoppingCartCommand.CMD_LOGOUT); setResponsePage(Application.get().getHomePage(), logOutParams); } final Model<Customer> customerModel = new Model<>(customer); add(new FeedbackPanel(FEEDBACK)); add(new CustomerOrderPanel(ORDERS_PANEL, customerModel)); add(new StandardFooter(FOOTER)); add(new StandardHeader(HEADER)); add(new ServerSideJs("serverSideJs")); add(new HeaderMetaInclude("headerInclude")); }
Example #7
Source File: AbstractMobileEditForm.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
@SuppressWarnings("serial") protected void init() { add(new FeedbackPanel("feedback").setOutputMarkupId(true)); final SubmitLink submitButton = new SubmitLink("submitButton") { @Override public final void onSubmit() { parentPage.save(); } }; final RepeatingView flowform = new RepeatingView("flowform"); add(flowform); gridBuilder = newGridBuilder(flowform); add(submitButton); if (isNew() == true) { submitButton.add(new Label("label", getString("create"))); } else { submitButton.add(new Label("label", getString("update"))); } }
Example #8
Source File: FieldInstanceErrorPanel.java From ontopia with Apache License 2.0 | 6 votes |
public FieldInstanceErrorPanel(String id, final FieldInstanceModel fieldInstanceModel, Exception e) { super(id, fieldInstanceModel); FieldInstance fieldInstance = fieldInstanceModel.getFieldInstance(); FieldAssignment fieldAssignment = fieldInstance.getFieldAssignment(); FieldDefinition fieldDefinition = fieldAssignment.getFieldDefinition(); add(new FieldDefinitionLabel("fieldLabel", new FieldDefinitionModel(fieldDefinition))); error(AbstractFieldInstancePanel.createErrorMessage(fieldInstanceModel, e)); // set up container this.fieldValuesContainer = new WebMarkupContainer("fieldValuesContainer"); fieldValuesContainer.setOutputMarkupId(true); add(fieldValuesContainer); // add feedback panel this.feedbackPanel = new FeedbackPanel("feedback", new AbstractFieldInstancePanelFeedbackMessageFilter()); feedbackPanel.setOutputMarkupId(true); fieldValuesContainer.add(feedbackPanel); }
Example #9
Source File: ResetPage.java From yes-cart with Apache License 2.0 | 6 votes |
/** * Construct page. * * @param params page parameters */ public ResetPage(final PageParameters params) { super(params); add( new FeedbackPanel(FEEDBACK) ).add( new ResetPanel(AUTH_VIEW, params.get("token").toString()) ).add( new StandardFooter(FOOTER) ).add( new StandardHeader(HEADER) ).add( new ServerSideJs("serverSideJs") ).add( new HeaderMetaInclude("headerInclude") ); }
Example #10
Source File: MyPictures.java From sakai with Educational Community License v2.0 | 5 votes |
public FileUploadForm(String id, String userUuid, FeedbackPanel fileFeedback) { super(id); this.userUuid = userUuid; this.fileFeedback = fileFeedback; // set form to multipart mode setMultiPart(true); setMaxSize(Bytes.megabytes(sakaiProxy.getMaxProfilePictureSize() * ProfileConstants.MAX_GALLERY_FILE_UPLOADS)); }
Example #11
Source File: MyPicture.java From sakai with Educational Community License v2.0 | 5 votes |
private void configureFeedback() { // activate feedback panel final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); feedbackPanel.setVisible(false); add(feedbackPanel); // don't show filtered feedback errors in feedback panel int[] filteredErrorLevels = new int[] { FeedbackMessage.ERROR }; feedbackPanel.setFilter(new ErrorLevelsFeedbackMessageFilter( filteredErrorLevels)); }
Example #12
Source File: DashboardEmbedCodePanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public DashboardEmbedCodePanel(String id, final String dashboardId) { super(id); model = new ErrorLoadableDetachableModel(dashboardId); final Label codeLabel = new Label("code", model); codeLabel.setEscapeModelStrings(false); codeLabel.setOutputMarkupId(true); add(codeLabel); feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); add(feedbackPanel); }
Example #13
Source File: SignInPage.java From ontopia with Apache License 2.0 | 5 votes |
public SignInForm(String id) { super(id); setDefaultModel(new CompoundPropertyModel<SignInForm>(this)); add(new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(this))); add(new TextField<String>("username")); add(new PasswordTextField("password")); }
Example #14
Source File: ViewPicture.java From sakai with Educational Community License v2.0 | 5 votes |
private void configureFeedback() { // activate feedback panel final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); feedbackPanel.setVisible(false); add(feedbackPanel); // don't show filtered feedback errors in feedback panel int[] filteredErrorLevels = new int[] { FeedbackMessage.ERROR }; feedbackPanel.setFilter(new ErrorLevelsFeedbackMessageFilter( filteredErrorLevels)); }
Example #15
Source File: ViewPictures.java From sakai with Educational Community License v2.0 | 5 votes |
private void configureFeedback() { // activate feedback panel final FeedbackPanel feedback = new FeedbackPanel("feedback"); feedback.setOutputMarkupId(true); add(feedback); // don't show filtered feedback errors in feedback panel int[] filteredErrorLevels = new int[] { FeedbackMessage.ERROR }; feedback.setFilter(new ErrorLevelsFeedbackMessageFilter( filteredErrorLevels)); }
Example #16
Source File: MyPicture.java From sakai with Educational Community License v2.0 | 5 votes |
private void configureFeedback() { // activate feedback panel final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); feedbackPanel.setVisible(false); add(feedbackPanel); // don't show filtered feedback errors in feedback panel int[] filteredErrorLevels = new int[] { FeedbackMessage.ERROR }; feedbackPanel.setFilter(new ErrorLevelsFeedbackMessageFilter( filteredErrorLevels)); }
Example #17
Source File: MyPictures.java From sakai with Educational Community License v2.0 | 5 votes |
public FileUploadForm(String id, String userUuid, FeedbackPanel fileFeedback) { super(id); this.userUuid = userUuid; this.fileFeedback = fileFeedback; // set form to multipart mode setMultiPart(true); setMaxSize(Bytes.megabytes(sakaiProxy.getMaxProfilePictureSize() * ProfileConstants.MAX_GALLERY_FILE_UPLOADS)); }
Example #18
Source File: LoginMobilePage.java From projectforge-webapp with GNU General Public License v3.0 | 5 votes |
@SuppressWarnings({ "unchecked", "rawtypes"}) public LoginMobilePage(final PageParameters parameters) { super(parameters); final PFUserDO wicketSessionUser = ((MySession) getSession()).getUser(); final PFUserDO sessionUser = UserFilter.getUser(WicketUtils.getHttpServletRequest(getRequest())); // Sometimes the wicket session user is given but the http session user is lost (re-login required). if (wicketSessionUser != null && sessionUser != null && wicketSessionUser.getId() == sessionUser.getId()) { final Integer userId = sessionUser.getId(); final RecentMobilePageInfo pageInfo = (RecentMobilePageInfo) userXmlPreferencesCache.getEntry(userId, AbstractSecuredMobilePage.USER_PREF_RECENT_PAGE); if (pageInfo != null && pageInfo.getPageClass() != null) { throw new RestartResponseException((Class) pageInfo.getPageClass(), pageInfo.restorePageParameters()); } else { throw new RestartResponseException(WicketUtils.getDefaultMobilePage()); } } setNoBackButton(); form = new LoginMobileForm(this); pageContainer.add(form); form.init(); pageContainer.add(new FeedbackPanel("feedback").setOutputMarkupId(true)); final String messageOfTheDay = configuration.getStringValue(ConfigurationParam.MESSAGE_OF_THE_DAY); if (StringUtils.isBlank(messageOfTheDay) == true) { pageContainer.add(new Label("messageOfTheDay", "[invisible]").setVisible(false)); } else { pageContainer.add(new Label("messageOfTheDay", messageOfTheDay).setEscapeModelStrings(false)); } @SuppressWarnings("serial") final Link<Void> goButton = new Link<Void>("goFullWebVersion") { @Override public final void onClick() { setResponsePage(LoginPage.class, LoginPage.forceNonMobile()); } }; pageContainer.add(goButton); }
Example #19
Source File: ViewPictures.java From sakai with Educational Community License v2.0 | 5 votes |
private void configureFeedback() { // activate feedback panel final FeedbackPanel feedback = new FeedbackPanel("feedback"); feedback.setOutputMarkupId(true); add(feedback); // don't show filtered feedback errors in feedback panel int[] filteredErrorLevels = new int[] { FeedbackMessage.ERROR }; feedback.setFilter(new ErrorLevelsFeedbackMessageFilter( filteredErrorLevels)); }
Example #20
Source File: ViewPicture.java From sakai with Educational Community License v2.0 | 5 votes |
private void configureFeedback() { // activate feedback panel final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); feedbackPanel.setVisible(false); add(feedbackPanel); // don't show filtered feedback errors in feedback panel int[] filteredErrorLevels = new int[] { FeedbackMessage.ERROR }; feedbackPanel.setFilter(new ErrorLevelsFeedbackMessageFilter( filteredErrorLevels)); }
Example #21
Source File: ProfilePage.java From yes-cart with Apache License 2.0 | 5 votes |
/** * Construct page. * * @param params page parameters */ public ProfilePage(final PageParameters params) { super(params); final String email = getCurrentCart().getCustomerEmail(); final Customer customer; if (StringUtils.isNotBlank(email)) { customer = customerServiceFacade.getCustomerByEmail(getCurrentShop(), email); } else { customer = null; // Redirect away from profile! final PageParameters logOutParams = new PageParameters(); logOutParams.set(ShoppingCartCommand.CMD_LOGOUT, ShoppingCartCommand.CMD_LOGOUT); setResponsePage(Application.get().getHomePage(), logOutParams); } final Model<Customer> customerModel = new Model<>(customer); add(new FeedbackPanel(FEEDBACK)); add(new PasswordPanel(PASSWORD_PANEL, customerModel)); add(new DeleteAccountPanel(DELETE_PANEL, customerModel)); add(new ManageAddressesView(SHIPPING_ADDR_PANEL, customerModel, Address.ADDR_TYPE_SHIPPING, false)); add(new ManageAddressesView(BILLING_ADDR_PANEL, customerModel, Address.ADDR_TYPE_BILLING, false)); add(new DynaFormPanel(ATTR_PANEL, customerModel)); add(new SummaryPanel(SUMMARY_PANEL, customerModel)); add(new StandardFooter(FOOTER)); add(new StandardHeader(HEADER)); add(new ServerSideJs("serverSideJs")); add(new HeaderMetaInclude("headerInclude")); }
Example #22
Source File: LicenseErrorPage.java From nextreports-server with Apache License 2.0 | 5 votes |
public LicenseErrorPage(PageParameters parameters) { String error = parameters.get("errorMessage").toString(); FeedbackPanel uploadFeedback = new FeedbackPanel("uploadFeedback"); add(uploadFeedback); add(new Label("curentUser", NextServerSession.get().getUsername())); add(new Label("realName", NextServerSession.get().getRealName())); add(new Link<String>("logout") { private static final long serialVersionUID = 1L; @Override public void onClick() { NextServerSession.get().signOut(); setResponsePage(getApplication().getHomePage()); } }); Form<Void> uploadLicenseForm = new UploadLicenseForm("licenseForm"); uploadLicenseForm.add(new UploadProgressBar("progress", uploadLicenseForm)); if (!NextServerSession.get().isAdmin()) { error = "Please contact your administrator : " + error; uploadLicenseForm.setVisible(false); } add(new Label("error", error)); add(uploadLicenseForm); }
Example #23
Source File: FormPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public FormPanel(String id, FormContentPanel<T> contentPanel, boolean useByDialog) { super(id); setOutputMarkupId(true); this.contentPanel = contentPanel; WebMarkupContainer container = new WebMarkupContainer("form-parent"); add(container); feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); container.add(feedbackPanel); form = new Form<T>("form", contentPanel.getModel()); form.add(contentPanel); container.add(form); cancelButton = createCancelButton(); form.add(cancelButton); applyButton = createApplyButton(); applyButton.setVisible(false); form.add(applyButton); okButton = createOkButton(); form.add(okButton); if (useByDialog) { container.add(AttributeModifier.append("class", "form-container form-container-dialog")); } }
Example #24
Source File: ResultPage.java From yes-cart with Apache License 2.0 | 5 votes |
/** * Construct page. * * @param params page parameters */ public ResultPage(final PageParameters params) { super(params); add(new StandardFooter(FOOTER)); add(new StandardHeader(HEADER)); add(new FeedbackPanel(FEEDBACK)); add(new ServerSideJs("serverSideJs")); add(new HeaderMetaInclude("headerInclude")); }
Example #25
Source File: AddDrillDownPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public AddDrillDownPanel(String id, Entity entity) { super(id); int index = DrillDownUtil.getCurrentDrillIndex(entity); DrillDownEntity drillEntity = new DrillDownEntity(); String name = String.valueOf(index); drillEntity.setName(name); drillEntity.setPath(entity.getPath() + StorageConstants.PATH_SEPARATOR + "drillDownEntities" + StorageConstants.PATH_SEPARATOR + name); drillEntity.setIndex(index); DrillForm form = new DrillForm("form", drillEntity, entity); feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); add(feedbackPanel); add(form); }
Example #26
Source File: BasePage.java From onedev with MIT License | 4 votes |
public FeedbackPanel getSessionFeedback() { return sessionFeedback; }
Example #27
Source File: AbstractForm.java From projectforge-webapp with GNU General Public License v3.0 | 4 votes |
protected FeedbackPanel createFeedbackPanel() { final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); return feedbackPanel; }
Example #28
Source File: ErrorPage.java From projectforge-webapp with GNU General Public License v3.0 | 4 votes |
public ErrorPage(final Throwable throwable) { super(null); errorMessage = getString("errorpage.unknownError"); messageNumber = null; Throwable rootCause = null; showFeedback = true; if (throwable != null) { rootCause = ExceptionHelper.getRootCause(throwable); if (rootCause instanceof ProjectForgeException) { errorMessage = getExceptionMessage(this, (ProjectForgeException) rootCause, true); } else if (throwable instanceof ServletException) { messageNumber = String.valueOf(System.currentTimeMillis()); log.error("Message #" + messageNumber + ": " + throwable.getMessage(), throwable); if (rootCause != null) { log.error("Message #" + messageNumber + " rootCause: " + rootCause.getMessage(), rootCause); } errorMessage = getLocalizedMessage(UserException.I18N_KEY_PLEASE_CONTACT_DEVELOPER_TEAM, messageNumber); } else if (throwable instanceof PageExpiredException) { log.info("Page expired (session time out)."); showFeedback = false; errorMessage = getString("message.wicket.pageExpired"); title = getString("message.title"); } else { messageNumber = String.valueOf(System.currentTimeMillis()); log.error("Message #" + messageNumber + ": " + throwable.getMessage(), throwable); errorMessage = getLocalizedMessage(UserException.I18N_KEY_PLEASE_CONTACT_DEVELOPER_TEAM, messageNumber); } } form = new ErrorForm(this); final String receiver = Configuration.getInstance().getStringValue(ConfigurationParam.FEEDBACK_E_MAIL); form.data.setReceiver(receiver); form.data.setMessageNumber(messageNumber); form.data.setMessage(throwable != null ? throwable.getMessage() : ""); form.data.setStackTrace(throwable != null ? ExceptionHelper.printStackTrace(throwable) : ""); form.data.setSender(PFUserContext.getUser().getFullname()); final String subject = "ProjectForge-Error #" + form.data.getMessageNumber() + " from " + form.data.getSender(); form.data.setSubject(subject); if (rootCause != null) { form.data.setRootCause(rootCause.getMessage()); form.data.setRootCauseStackTrace(ExceptionHelper.printStackTrace(rootCause)); } final boolean visible = showFeedback == true && messageNumber != null && StringUtils.isNotBlank(receiver); body.add(form); if (visible == true) { form.init(); } form.setVisible(visible); final Label errorMessageLabel = new Label("errorMessage", errorMessage); body.add(errorMessageLabel.setVisible(errorMessage != null)); final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); body.add(feedbackPanel); }
Example #29
Source File: AbstractEditForm.java From projectforge-webapp with GNU General Public License v3.0 | 4 votes |
public FeedbackPanel getFeedbackPanel() { return feedbackPanel; }
Example #30
Source File: SearchEntityPanel.java From nextreports-server with Apache License 2.0 | 4 votes |
public SearchEntityPanel(String id, final String path) { super(id); this.sectionId = ((EntitySection) sectionManager.getSelectedSection()).getId(); this.path = path; SearchContext searchContext = NextServerSession.get().getSearchContext(); if (searchContext != null) { this.path = searchContext.getPath(); } provider = new EntityListDataProvider(); AdvancedForm form = new SearchForm("form"); feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); feedbackPanel.setEscapeModelStrings(false); List<SearchEntry> searchEntries = Collections.emptyList(); if (searchContext != null) { searchEntries = searchContext.getSearchEntries(); } if (searchEntries.size() > 0) { try { Entity[] entities = storageService.search(searchEntries, null); provider.setList(Arrays.asList(entities)); } catch (Exception e) { e.printStackTrace(); error(e.getMessage()); } } add(new Label("title", getString("ActionContributor.Search.name") + " " + getString("Section." + sectionManager.getSelectedSection().getTitle() + ".name"))); resultsLabel = new MultiLineLabel("resultsLabel", new Model() { @Override public Serializable getObject() { return getSearchString(); } }); resultsLabel.setOutputMarkupId(true); resultsLabel.setVisible(false); form.add(resultsLabel); container = new WebMarkupContainer("table-container"); container.setOutputMarkupId(true); container.setVisible(false); form.add(container); final AjaxCheckTablePanel<Entity> tablePanel = createTablePanel(provider); container.add(tablePanel); form.add(feedbackPanel); submitLink = new AjaxSubmitConfirmLink("deleteLink", getString("deleteEntities")) { private static final long serialVersionUID = 1L; protected void onSubmit(AjaxRequestTarget target, Form<?> form) { if (StorageUtil.isCommonPath(tablePanel.getSelected())) { error(getString("deleteEntitiesAmbiguous")); target.add(feedbackPanel); } else { for (Entity h : tablePanel.getSelected()) { try { if (!StorageUtil.isSystemPath(h.getPath()) && securityService.hasPermissionsById(ServerUtil.getUsername(), PermissionUtil.getDelete(), h.getId())) { storageService.removeEntityById(h.getId()); } } catch (Exception e) { e.printStackTrace(); add(new AlertBehavior(e.getMessage())); target.add(this); } } if (tablePanel.getSelected().size() > 0) { tablePanel.unselectAll(); refresh(target); } } } @Override protected void onError(AjaxRequestTarget target, Form<?> form) { target.add(feedbackPanel); } }; submitLink.setVisible(false); form.add(submitLink); add(form); setOutputMarkupId(true); }