Package org.apache.tapestry5

Examples of org.apache.tapestry5.ComponentResources


    @Test
    public void trigger_immediate()
    {
        FormSupport support = mockFormSupport();
        ComponentResources resources = mockComponentResources();
        Heartbeat heartbeat = new HeartbeatImpl();
        Request request = mockRequest();

        String elementName = "myname";

        train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, null);
        train_getParameter(request, elementName, "login");

        replay();

        heartbeat.begin();

        Submit submit = new Submit(request);

        TestBase.set(submit, "resources", resources, "formSupport", support, "heartbeat", heartbeat, "defer", false);

        submit.processSubmission("xyz", elementName);

        verify();

        expect(resources.triggerEvent(EventConstants.SELECTED, null, null)).andReturn(false);

        replay();

        heartbeat.end();
View Full Code Here


        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer five = 5;
        FormSupport fs = mockFormSupport();
        ValidatorMacro macro = mockValidatorMacro();
        Messages globalMessages = mockMessages();
View Full Code Here

        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer five = 5;
        FormSupport fs = mockFormSupport();
        ValidatorMacro macro = mockValidatorMacro();
        Messages globalMessages = mockMessages();
View Full Code Here

    @Test
    public void test_imagesubmit_event_fired()
    {
        Request request = mockRequest();
        final ComponentResources resources = mockComponentResources();
        FormSupport formSupport = mockFormSupport();
        Asset image = mockAsset();

        String elementName = "myname";
View Full Code Here

    @Test
    public void test_submit_event_fired()
    {
        Request request = mockRequest();
        final ComponentResources resources = mockComponentResources();
        FormSupport formSupport = mockFormSupport();

        String elementName = "myname";

        train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, null);
View Full Code Here

    }

    @Override
    protected Link createLink(Object[] eventContext)
    {
        ComponentResources containerResources = resources.getContainerResources();

        return containerResources.createEventLink(event, eventContext);
    }
View Full Code Here

public class JavaScriptSupportImplTest extends InternalBaseTestCase
{
    @Test
    public void allocate_id_from_resources()
    {
        ComponentResources resources = mockComponentResources();

        train_getId(resources, "tracy");

        replay();
View Full Code Here

        train_getModel(ins, model);

        replay();

        ComponentResources resources = new InternalComponentResourcesImpl(null, null, null, elementResources, "id",
                null, ins, false);

        resources.storeRenderVariable("myRenderVar", value);

        assertSame(resources.getRenderVariable("myrendervar"), value);

        verify();
    }
View Full Code Here

        train_getModel(ins, model);

        replay();

        ComponentResources resources = new InternalComponentResourcesImpl(null, null, null, elementResources,
                "Foo.bar", null, ins, false);

        resources.storeRenderVariable("fred", "FRED");
        resources.storeRenderVariable("barney", "BARNEY");

        try
        {
            resources.getRenderVariable("wilma");
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(
View Full Code Here

    public FieldValidator createValidator(Field field, String validatorType, String constraintValue)
    {
        Component component = (Component) field;
        assert InternalUtils.isNonBlank(validatorType);
        ComponentResources componentResources = component.getComponentResources();
        String overrideId = componentResources.getId();

        // So, if you use a TextField on your EditUser page, we want to search the messages
        // of the EditUser page (the container), not the TextField (which will always be the same).

        Messages overrideMessages = componentResources.getContainerMessages();

        return createValidator(field, validatorType, constraintValue, overrideId, overrideMessages, null);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ComponentResources

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.