Package org.springmodules.xt.ajax.component

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


        MockHttpServletResponse httpResponse = new MockHttpServletResponse();
        AjaxResponse ajaxResponse = new AjaxResponseImpl("UTF-8");
       
        String text = "questo è un semplice testo";
       
        ajaxResponse.addAction(new ReplaceContentAction("test", new SimpleText(text)));
       
        this.sender.sendResponse(httpResponse, ajaxResponse);
       
        assertTrue(httpResponse.getContentAsString().contains(text));
    }
View Full Code Here


    public ReplaceElementActionTest(String testName) {
        super(testName);
    }
   
    public void testRender() throws Exception {
        AjaxAction action = new ReplaceElementAction("testId", new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
View Full Code Here

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

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

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

    public AjaxResponseImplTest(String testName) {
        super(testName);
    }

    public void testRender() throws Exception {
        AppendContentAction action1 = new AppendContentAction("action1", new SimpleText("Test Text"));
        ReplaceContentAction action2 = new ReplaceContentAction("action2", new SimpleText("Test Text"));
        AjaxResponseImpl response = new AjaxResponseImpl();
       
        response.addAction(action1);
        response.addAction(action2);
       
View Full Code Here

*/
public class DummySubmitHandler extends AbstractAjaxHandler {

    public AjaxResponse submit(AjaxSubmitEvent e) {
        AjaxResponseImpl response = new AjaxResponseImpl();
        AppendContentAction action = new AppendContentAction("submit", new SimpleText("submit"));
        response.addAction(action);
        return response;
    }
View Full Code Here

*/
public class DummyHandler extends AbstractAjaxHandler {
   
    public AjaxResponse action(AjaxActionEvent e) {
        AjaxResponseImpl response = new AjaxResponseImpl();
        AppendContentAction action = new AppendContentAction("action", new SimpleText("action"));
        response.addAction(action);
        return response;
    }
View Full Code Here

        Map model = event.getModel();
        IOffice office = form.getOffice();
        Collection<IEmployee> employees = (Collection) model.get("employees");
       
        // Create the simple text message:
        SimpleText message = new SimpleText(new StringBuilder("Selected office: ").append(office.getName()).toString());
        // Create an ajax action for setting the message and hi:
        ReplaceContentAction setMessageAction = new ReplaceContentAction("message", message);
        // Create an highlighting effect action for the appearing message:
        Effect highlightAction = new Effect("Highlight", "message");
        highlightAction.addOption("duration", 0.5);
View Full Code Here

        IOffice droppableOffice = store.getOffice(event.getHttpRequest().getParameter(OFFICE_ID));
       
        if (! droppableOffice.getEmployees().contains(draggedEmployee)) {
            BindStatusHelper helper = new BindStatusHelper("command.employees");
           
            ListItem item = new ListItem(new SimpleText(draggedEmployee.getFirstname() + " " + draggedEmployee.getSurname()));
            InputField hidden = new InputField(helper.getStatusExpression(), draggedEmployee.getMatriculationCode(), InputField.InputType.HIDDEN);
           
            AppendContentAction appendAction = new AppendContentAction("employees", new LinkedList<Component>(Arrays.asList(item, hidden)));
           
            AjaxResponse response = new AjaxResponseImpl();
View Full Code Here

TOP

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

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.