Package org.springmodules.xt.ajax

Examples of org.springmodules.xt.ajax.AjaxAction


        assertXpathEvaluatesTo("testId", "/insert-before/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new InsertContentBeforeAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-before/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-before/content/div[position()=2]", result);
View Full Code Here


        Component component = this.callback.getRenderingComponent(this.errors.getGlobalError(), this.messageSource, new Locale("it"));
        assertXpathEvaluatesTo("Default Message 1", "//div", component.render());
    }

    public void testGetRenderingAction() throws Exception {
        AjaxAction action = this.callback.getRenderingAction(this.errors.getGlobalError());
        String rendering = action.render();
        assertXpathExists("//script", rendering);
        assertTrue(rendering.indexOf("new Effect.Highlight(\"ErrorCode1\",{\"startcolor\":\"#FF0A0A\"});") != -1);
    }  
View Full Code Here

        assertXpathEvaluatesTo("testId", "/insert-before/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new InsertContentBeforeAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-before/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-before/content/div[position()=2]", result);
View Full Code Here

        assertXpathEvaluatesTo("testId1,testId2", "/insert-before/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithSelectorMatcher() throws Exception {
        ElementMatcher matcher = new SelectorMatcher(Arrays.asList("#testId1", "#testId2"));
        AjaxAction action = new InsertContentBeforeAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-before/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-before/content/div[position()=2]", result);
View Full Code Here

        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");
            response.addAction(removeAction);
            response.addAction(replaceAction);
            response.addAction(effectAction);
        } else {
            AjaxAction removeAction = new RemoveContentAction("onErrorsMessage");
            response.addAction(removeAction);
        }
    }
View Full Code Here

    public AppendAsFirstContentActionTest(String testName) {
        super(testName);
    }
   
    public void testRender() throws Exception {
        AjaxAction action = new AppendAsFirstContentAction("testId", Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/append-as-first-child/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/append-as-first-child/content/div[position()=2]", result);
View Full Code Here

        assertXpathEvaluatesTo("testId", "/append-as-first-child/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new AppendAsFirstContentAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/append-as-first-child/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/append-as-first-child/content/div[position()=2]", result);
View Full Code Here

        assertXpathEvaluatesTo("testId1,testId2", "/append-as-first-child/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new AppendAsFirstContentAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/append-as-first-child/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/append-as-first-child/content/div[position()=2]", result);
View Full Code Here

        assertXpathEvaluatesTo("testId", "/append-as-first-child/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithSelectorMatcher() throws Exception {
        ElementMatcher matcher = new SelectorMatcher(Arrays.asList("#testId1", "#testId2"));
        AjaxAction action = new AppendAsFirstContentAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/append-as-first-child/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/append-as-first-child/content/div[position()=2]", result);
View Full Code Here

    public void testRender() throws Exception {
        Map model = new HashMap();
       
        model.put("ex", "ex");
       
        AjaxAction action = new RedirectAction("/ajax/redirect.action", model);
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("/ajax/redirect.action?ex=ex", "/redirect/content/target/@url", result);
    }
View Full Code Here

TOP

Related Classes of org.springmodules.xt.ajax.AjaxAction

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.