Package org.springmodules.xt.ajax.component

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


    /**
     * Get the default error component.<br>
     * This renders the error as plain text.
     */
    public Component getErrorComponent(AjaxSubmitEvent event, ObjectError error, MessageSource messageSource, Locale locale) {
        return new TaggedText(messageSource.getMessage(error.getCode(), error.getArguments(), error.getDefaultMessage(), locale),
                TaggedText.Tag.DIV);
    }
View Full Code Here


    public InsertContentAfterActionTest(String testName) {
        super(testName);
    }
   
    public void testRender() throws Exception {
        AjaxAction action = new InsertContentAfterAction("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);
       
View Full Code Here

        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("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("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

    public InsertContentBeforeActionTest(String testName) {
        super(testName);
    }
   
    public void testRender() throws Exception {
        AjaxAction action = new InsertContentBeforeAction("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);
       
View Full Code Here

        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("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

        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);
       
View Full Code Here

   
    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);
        Effect action2 = new Effect("Shake", "onSuccessMessage");
View Full Code Here

TOP

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

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.