Package org.springmodules.xt.ajax

Examples of org.springmodules.xt.ajax.ElementMatcher


            request.getSession(true).removeAttribute(this.getErrorsAttributeName(request));
            // Remove old errors from HTML:
            ObjectError[] errors = errorsContainer.getErrors();
            for (ObjectError error : errors) {
                if (this.rendersError(error)) {
                    ElementMatcher matcher = this.getElementMatcherForError(error);
                    RemoveContentAction removeAction = new RemoveContentAction(matcher);
                    response.addAction(removeAction);
                }
            }
        }
View Full Code Here


        request.getSession(true).setAttribute(this.getErrorsAttributeName(request),
                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);
View Full Code Here

        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
        assertXpathEvaluatesTo("testId", "/insert-after/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new InsertContentAfterAction(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);
View Full Code Here

        assertXpathEvaluatesTo("wildcard", "/insert-after/context/matcher/@matchMode", result);
        assertXpathEvaluatesTo("testId", "/insert-after/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new InsertContentAfterAction(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);
View Full Code Here

        assertXpathEvaluatesTo("plain", "/insert-after/context/matcher/@matchMode", result);
        assertXpathEvaluatesTo("testId1,testId2", "/insert-after/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithSelectorMatcher() throws Exception {
        ElementMatcher matcher = new SelectorMatcher(Arrays.asList("#testId1", "#testId2"));
        AjaxAction action = new InsertContentAfterAction(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);
View Full Code Here

        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("testId", "/append-as-children/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
View Full Code Here

        assertXpathEvaluatesTo("wildcard", "/append-as-children/context/matcher/@matchMode", result);
        assertXpathEvaluatesTo("testId", "/append-as-children/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
View Full Code Here

        assertXpathEvaluatesTo("plain", "/append-as-children/context/matcher/@matchMode", result);
        assertXpathEvaluatesTo("testId1,testId2", "/append-as-children/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithSelectorMatcher() throws Exception {
        ElementMatcher matcher = new SelectorMatcher(Arrays.asList("#testId1", "#testId2"));
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
View Full Code Here

        assertXpathEvaluatesTo("Test Component 2", "/insert-before/content/div[position()=2]", result);
        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);
View Full Code Here

        assertXpathEvaluatesTo("wildcard", "/insert-before/context/matcher/@matchMode", result);
        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);
View Full Code Here

TOP

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

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.