Package org.springmodules.xt.ajax.component

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


                new ErrorsContainer(errors.toArray(new ObjectError[errors.size()])));
        // Put new errors into HTML:
        for (ObjectError error : errors) {
            if (this.rendersError(error)) {
                ElementMatcher matcher = this.getElementMatcherForError(error);
                Component renderingComponent = this.errorRenderingCallback.getErrorComponent(event, error, this.messageSource, locale);
                AppendContentAction appendAction = new AppendContentAction(matcher, renderingComponent);
                response.addAction(appendAction);
                // Get the actions to execute *after* rendering the component:
                AjaxAction[] renderingActions = this.errorRenderingCallback.getErrorActions(event, error);
                if (renderingActions != null) {
View Full Code Here


        this.errors.addError(new ObjectError("command", new String[]{"ErrorCode1"}, null, "Default Message 1"));
        this.messageSource = new DelegatingMessageSource();
    }

    public void testGetRenderingComponent() throws Exception {
        Component component = this.callback.getRenderingComponent(this.errors.getGlobalError(), this.messageSource, new Locale("it"));
        assertXpathEvaluatesTo("Default Message 1", "//div", component.render());
    }
View Full Code Here

        assertXpathExists("//script", rendering);
        assertTrue(rendering.indexOf("new Effect.Highlight(\"ErrorCode1\",{\"startcolor\":\"#FF0A0A\"});") != -1);
    }  
   
    public void testGetErrorComponent() throws Exception {
        Component component = this.callback.getErrorComponent(new AjaxSubmitEventImpl("submit", new MockHttpServletRequest()), this.errors.getGlobalError(), this.messageSource, new Locale("it"));
        assertXpathEvaluatesTo("Default Message 1", "//div", component.render());
    }
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);
            AjaxAction effectAction = new Effect("Shake", "onErrorsMessage");
View Full Code Here

TOP

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

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.