当前位置: 首页>>代码示例>>Java>>正文


Java FeedbackMessage.markRendered方法代码示例

本文整理汇总了Java中org.apache.wicket.feedback.FeedbackMessage.markRendered方法的典型用法代码示例。如果您正苦于以下问题:Java FeedbackMessage.markRendered方法的具体用法?Java FeedbackMessage.markRendered怎么用?Java FeedbackMessage.markRendered使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.feedback.FeedbackMessage的用法示例。


在下文中一共展示了FeedbackMessage.markRendered方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterRender

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public void afterRender(Component component) {
	FormComponent fc = (FormComponent) component;
	if (!fc.isValid()) {
		String error;
		if (fc.hasFeedbackMessage()) {
			FeedbackMessage first = fc.getFeedbackMessages().first();
			first.markRendered();
			error = first.getMessage().toString();
			
		} else {
			error = "Your input is invalid.";
		}
		fc.getResponse().write("*<span id=\"helpBlock2\" class=\"help-block\">"+error+"</span>");
		super.afterRender(component);
	}
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:18,代码来源:ValidationMsgBehavior.java

示例2: onConfigure

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
protected void onConfigure() {
	super.onConfigure();
	
	FeedbackMessages feedbackMessages = Session.get().getFeedbackMessages();
	
	if(feedbackMessages.hasMessage(getFeedbackMessageFilter())){
		messageHolder.setVisible(true);
		List<FeedbackMessage> messages = feedbackMessages.messages(getFeedbackMessageFilter());
		FeedbackMessage message = messages.get(0);
		onDisplayError(message);
		message.markRendered();
	} else {
		messageHolder.setVisible(false);
	}
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:17,代码来源:AjaxComponentFeedbackPanel.java

示例3: renderHead

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
	super.renderHead(response);
	
	List<FeedbackMessage> msgs = model.getObject();
	if(msgs.size()>0){
		for(Component component: messages.keySet()){
			StringBuffer sb = new StringBuffer();
			for(FeedbackMessage msg : messages.get(component)){
				sb.append(msg.getMessage()+"\n");
				msg.markRendered();
			}
			
			String script = "$(\"#"+component.getMarkupId()+"\")"
					+ ".popover({ 'trigger': 'focus', "
							   + "'placement': 'top', "
							   + "'content': \""+StringEscapeUtils.escapeEcmaScript(sb.toString())+"\", "
							   + "'template': '<div class=\"popover feedback-popover\"><div class=\"arrow\"></div><div class=\"popover-inner\"><h3 class=\"popover-title\"></h3><div class=\"popover-content\"><p></p></div></div></div>'"
					+ "});";
			script += "$(\"#"+component.getMarkupId()+"\").keypress(function(){ $(\"#"+this.getMarkupId()+"\").removeClass('has-error'); $(this).popover('destroy'); });";
			response.render(OnDomReadyHeaderItem.forScript(script));
		}
	}
	
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:26,代码来源:BootstrapFeedbackPopover.java

示例4: refresh

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
public final void refresh(final IPartialPageRequestHandler handler) {
    for (FeedbackMessage message : this.getModelObject()) {
        if (message.isError()) {
            this.notification.error(handler, message.getMessage());
        } else if (message.isWarning()) {
            // this is necessary before check for success and info in order to show warnings: isSuccess and isInfo
            // return true also in case of warnings ...
            this.notification.warn(handler, message.getMessage());
        } else if (message.isSuccess() || message.isInfo()) {
            this.notification.success(handler, message.getMessage());
        } else {
            this.notification.warn(handler, message.getMessage());
        }
        message.markRendered();
    }
}
 
开发者ID:apache,项目名称:syncope,代码行数:17,代码来源:NotificationPanel.java

示例5: transform

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public CharSequence transform(Component component, CharSequence cs) {
    CharSequence res = cs;
    FormComponent<?> fc = (FormComponent<?>) component;

    String span = "";
    if (!fc.isValid()) {
        for (FeedbackMessage message : fc.getFeedbackMessages()) {
            message.markRendered();
            String id = getWicketIdForErrorSpan(component);
            span = "<span id=\"" + id + "\" class=\"error-icon\">" + "<i class=\"" +
                    ValidationTooltipStyleGroupBehavior.VALIDATION_ERROR_ICON_CLASS +
                    "\" title = \""
                    + message.getMessage() + "\"></i></span>";
        }
    }
    res = cs + span;

    return res;
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:21,代码来源:ValidationTooltipStyleBehavior.java

示例6: getFormChildsFeedbackMessages

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
public String getFormChildsFeedbackMessages(final boolean markAsRendered)
{
  if (hasFormChildsFeedbackMessage() == false) {
    return null;
  }
  final StringBuffer buf = new StringBuffer();
  boolean first = true;
  for (final FormComponent< ? > formComponent : allFormComponents) {
    if (formComponent.hasFeedbackMessage() == true) {
      final FeedbackMessage feedbackMessage = formComponent.getFeedbackMessages().first();
      if (markAsRendered == true) {
        feedbackMessage.markRendered();
      }
      first = StringHelper.append(buf, first, feedbackMessage.getMessage().toString(), "\n");
    }
  }
  return buf.toString();
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:19,代码来源:AbstractFieldsetPanel.java

示例7: getObject

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public Object getObject() {
    StringBuffer initScript = new StringBuffer();

    // init
    String defaultFeedbackId = defaultFeedbackPanel == null
            ? "" : defaultFeedbackPanel.getMarkupId();

    initScript
            .append("(function(fd) {\n")
            .append("fd.init('")
            .append(defaultFeedbackId)
            .append("');\n");

    // add messages
    for (FeedbackMessage feedbackMessage : getCurrentMessages()) {
        feedbackMessage.markRendered();
        Serializable message = feedbackMessage.getMessage();

        String messageString = (message instanceof UnescapedFeedbackMessage) ?
                message.toString() : Strings.escapeMarkup(message.toString(), false, false).toString();
        initScript
                .append("fd.addMessage('")
                .append(getMarkupIdFor(feedbackMessage.getReporter()))
                .append("', '")
                .append(feedbackMessage.getLevelAsString())
                .append("', ")
                .append(asJsStringParam(messageString))
                .append(");\n");
    }

    initScript.append("fd.showMessages();\n");
    initScript.append("})(FeedbackDistributer);\n");
    return initScript;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:36,代码来源:FeedbackDistributer.java

示例8: populateItem

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
protected void populateItem(final ListItem<FeedbackMessage> listItem) {

	final FeedbackMessage message = listItem.getModelObject();
	message.markRendered();
	final Component label = newMessageDisplayComponent("message",
			message);
	listItem.add(label);
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:10,代码来源:StyledFeedbackPanel.java

示例9: onBeforeRender

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
protected void onBeforeRender() {
	super.onBeforeRender();

	List<FeedbackMessage> msgs = model.getObject();
	messages = new HashMap<Component, List<FeedbackMessage>>();
	
	for(FeedbackMessage msg : msgs){
		if(!messages.containsKey(msg.getReporter())) messages.put(msg.getReporter(), new ArrayList<FeedbackMessage>());
		messages.get(msg.getReporter()).add(msg);
		msg.markRendered();
	}
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:14,代码来源:BootstrapFeedbackPopover.java

示例10: transform

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
   public CharSequence transform(Component component, CharSequence cs) {
boolean added = false;
StringBuffer messageBuffer = new StringBuffer(BEFORE_MESSAGE);
boolean isRadio = false;
ComponentHierarchyIterator it = ((ComponentGroup) component).visitChildren(FormComponent.class);
for (Component n : it) {
    FormComponent<?> fc = (FormComponent<?>) n;
    if (!fc.isValid()) {
	if (fc instanceof DMDRadioChoice<?>) {
	    isRadio = true;
	}
	for (FeedbackMessage message : fc.getFeedbackMessages()) {
	    message.markRendered();
	    if (added) {
		messageBuffer.append(BR);
	    }
	    messageBuffer.append(message.getMessage());
	    added = true;
	}
    }
}

if (!added) {
    return cs;
}

messageBuffer.append(AFTER_MESSAGE);

StringBuffer b;
if (isRadio) {
    b = buildOutputForRadio(cs, messageBuffer, component);
} else {
    b = buildOutput(cs, messageBuffer);
}
return b.toString();
   }
 
开发者ID:Nocket,项目名称:nocket,代码行数:38,代码来源:ValidationTooltipStyleGroupBehavior.java

示例11: transform

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public CharSequence transform(Component component, CharSequence cs) {
    CharSequence res = cs;
    FormComponent<?> fc = (FormComponent<?>) component;
    if (!fc.isValid() && showInlineError) {

        for (FeedbackMessage message : fc.getFeedbackMessages()) {
            message.markRendered();
            String id = getWicketIdForErrorSpan(component);
            res = cs + "<p id=\"" + id + "\" class=\"error\">" + message.getMessage() + "</p>";
        }
    }

    return res;
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:16,代码来源:ValidationStyleBehavior.java

示例12: transform

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public CharSequence transform(Component component, CharSequence cs) {
    boolean added = false;
    StringBuffer messageBuffer = new StringBuffer(BEFORE_MESSAGE);
    boolean isRadioOrCheckbox = false;
    ComponentHierarchyIterator it = ((ComponentGroup) component).visitChildren(FormComponent.class);
    for (Component n : it) {
        FormComponent<?> fc = (FormComponent<?>) n;
        if (!fc.isValid()) {
            if (fc instanceof DMDRadioChoice<?>) {
                isRadioOrCheckbox = true;
            }
            for (FeedbackMessage message : fc.getFeedbackMessages()) {
                message.markRendered();
                if (added) {
                    messageBuffer.append(BR);
                }
                messageBuffer.append(message.getMessage());
                added = true;
            }
        }
    }

    if (!added) {
        return cs;
    }

    messageBuffer.append(AFTER_MESSAGE);

    StringBuffer b;
    if (isRadioOrCheckbox) {
        b = buildOutputForRadioOrCheckbox(cs, messageBuffer);
    } else {
        b = buildOutput(cs, messageBuffer);
    }
    return b.toString();
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:38,代码来源:ValidationStyleGroupBehavior.java

示例13: populateItem

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
protected void populateItem(ListItem<FeedbackMessage> listItem) {
	final FeedbackMessage message = listItem.getModelObject();
	message.markRendered();
	final Component label = newMessageDisplayComponent("message", message);
	final AttributeModifier levelModifier = AttributeModifier.append("class", getCSSClass(message));
	label.add(levelModifier);
	listItem.add(label);
}
 
开发者ID:aracrown,项目名称:ara-commons,代码行数:10,代码来源:BootstrapFeedbackPanel.java

示例14: renderFeedback

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
private String renderFeedback() {
	//	this.getComponent().getFeedbackMessage();
	FeedbackMessages fm = Session.get().getFeedbackMessages();
	
	Iterator<FeedbackMessage> iter = fm.iterator();
	StringBuilder sb = new StringBuilder();
	while (iter.hasNext()) {
		FeedbackMessage message = iter.next();
		if ((message.getReporter() != null) || message.isRendered()) {
			// if a component-level message, don't show it
			continue;
		}
		
		// if we are info stick set to info else set to message level
		String cssClassSuffix = "";
		switch (message.getLevel()) {
			case INFO_STICKY:
			case INFO_FADE:	
				cssClassSuffix = "INFO";
				break;
			case ERROR_STICKY:
				cssClassSuffix = "ERROR";
				break;
			default:
				cssClassSuffix = message.getLevelAsString();
				break;
		}			
		Serializable serializable = message.getMessage();
		
		// grab the message, if it's null use an empty string
		String msg = (serializable == null) ? StringUtils.EMPTY : serializable.toString();
		
		sb.append("$.jGrowl(\"").append(escape(msg)).append('\"');
		sb.append(", {");
		// set the css style, i.e. the theme
		sb.append("theme: \'jgrowl-").append(cssClassSuffix).append("\'");
           // set afterOpen
           String afterOpen = getAfterOpenJavaScript();
           if (StringUtils.isNotEmpty(afterOpen)) {
               sb.append(", afterOpen: " + getAfterOpenJavaScript());
           }
		// set sticky
		if (message.getLevel() > FeedbackMessage.INFO) {
			sb.append(", sticky: true");
		} else {
			// default is 3000 (3sec)
			sb.append(", life: 5000");
		}

		sb.append("});");

           message.markRendered();
	}
	
	return sb.toString();
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:57,代码来源:JGrowlAjaxBehavior.java


注:本文中的org.apache.wicket.feedback.FeedbackMessage.markRendered方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。