Java Code Examples for org.apache.wicket.markup.html.panel.FeedbackPanel#setOutputMarkupId()

The following examples show how to use org.apache.wicket.markup.html.panel.FeedbackPanel#setOutputMarkupId() . 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: ViewPicture.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
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 2
Source File: ViewPictures.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
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 3
Source File: MyPicture.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
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 4
Source File: ViewPicture.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
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 5
Source File: ViewPictures.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
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 6
Source File: MyPicture.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
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 7
Source File: DashboardEmbedCodePanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
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 8
Source File: FormPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
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 9
Source File: AddDrillDownPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
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 10
Source File: AbstractForm.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
protected FeedbackPanel createFeedbackPanel()
{
  final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback");
  feedbackPanel.setOutputMarkupId(true);
  return feedbackPanel;
}
 
Example 11
Source File: ErrorPage.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
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 12
Source File: AbstractMassEditForm.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("serial")
@Override
protected void init()
{
  super.init();
  feedbackPanel = new FeedbackPanel("feedback");
  feedbackPanel.setOutputMarkupId(true);
  add(feedbackPanel);

  gridBuilder = newGridBuilder(this, "flowform");

  actionButtons = new MyComponentsRepeater<SingleButtonPanel>("buttons");
  add(actionButtons.getRepeatingView());
  {
    final Button cancelButton = new Button("button", new Model<String>("cancel")) {
      @Override
      public final void onSubmit()
      {
        parentPage.cancel();
      }
    };
    cancelButton.setDefaultFormProcessing(false); // No validation of the
    final SingleButtonPanel cancelButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cancelButton, getString("cancel"),
        SingleButtonPanel.CANCEL);
    actionButtons.add(cancelButtonPanel);
  }
  {
    final Button updateAllButton = new Button("button", new Model<String>("updateAll")) {
      @Override
      public final void onSubmit()
      {
        parentPage.updateAll();
      }
    };
    final SingleButtonPanel updateAllButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), updateAllButton,
        getString("updateAll"), SingleButtonPanel.DEFAULT_SUBMIT);
    updateAllButton.add(AttributeModifier.replace("onclick", "return showUpdateQuestionDialog()"));
    actionButtons.add(updateAllButtonPanel);
    setDefaultButton(updateAllButton);
  }
}
 
Example 13
Source File: SearchEntityPanel.java    From nextreports-server with Apache License 2.0 4 votes vote down vote up
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);
 }