Package org.springmodules.xt.ajax.component

Examples of org.springmodules.xt.ajax.component.Image


public class SuccessMessageCallback implements SuccessRenderingCallback, MessageSourceAware {
   
    private MessageSource messageSource;
   
    public AjaxAction[] getSuccessActions(AjaxSubmitEvent ajaxSubmitEvent) {
        Image img = new Image(ajaxSubmitEvent.getHttpRequest().getContextPath() + "/images/ok.gif", "success");
        TaggedText msg = new TaggedText(
                this.messageSource.getMessage("message.successful", null, "Successful", LocaleContextHolder.getLocale()),
                TaggedText.Tag.SPAN);
       
        ReplaceContentAction action1 = new ReplaceContentAction("onSuccessMessage", img, msg);
View Full Code Here


    }
   
    private void renderErrorMessage(AjaxActionEvent event, AjaxResponse response, String messageCode, String defaultMessage) {
        // If errors occur, render an error message with a proper icon:
        String message = this.messageSource.getMessage(messageCode, null, defaultMessage, LocaleContextHolder.getLocale());
        Image img = new Image(event.getHttpRequest().getContextPath() + "/images/error.gif", "error");
        TaggedText txt = new TaggedText(message, TaggedText.Tag.SPAN);
        // Put the message in its proper web page space:
        ReplaceContentAction action1 = new ReplaceContentAction("message", img, txt);
        // Shake the message:
        Effect action2 = new Effect("Shake", "message");
View Full Code Here

*/
public class CustomValidationHandler extends DefaultValidationHandler {
   
    protected void afterValidation(AjaxSubmitEvent event, AjaxResponse response) {
        if (event.getValidationErrors() != null && event.getValidationErrors().hasErrors()) {
            Component errorImage = new Image(event.getHttpRequest().getContextPath() + "/images/error.gif", "error");
            Component errorMessage = new TaggedText(
                    this.messageSource.getMessage("message.error", null, "Error", LocaleContextHolder.getLocale()),
                    TaggedText.Tag.SPAN);
            AjaxAction removeAction = new RemoveContentAction("onSuccessMessage");
            AjaxAction replaceAction = new ReplaceContentAction("onErrorsMessage", errorImage, errorMessage);
View Full Code Here

TOP

Related Classes of org.springmodules.xt.ajax.component.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.