Package org.apache.tapestry.internal.event

Examples of org.apache.tapestry.internal.event.IComponentEventInvoker.addEventListener()


        spec.addEventListener("comp1", new String[] {"onclick", "onchange"}, "testMethod", "form1", true, true, false, false);
        invoker.addEventListener("comp1", spec);
        invoker.addFormEventListener("form1", spec);
       
        spec.addEventListener("comp2", new String[] {"onclick"}, "testAnotherMethod", "form1", true, true, false, false);
        invoker.addEventListener("comp2", spec);
        invoker.addFormEventListener("form1", spec);
       
        // render of comp1
       
        expect(cycle.isRewinding()).andReturn(false);
View Full Code Here


        IForm form = newMock(IForm.class);
        IComponentSpecification formSpec = new ComponentSpecification();
       
        // now test render
        spec.addEventListener("comp1", new String[] {"onclick"}, "testMethod", "form1", false, true, false, false);
        invoker.addEventListener("comp1", spec);
        invoker.addFormEventListener("form1", spec);
       
        spec.addEventListener("comp2", new String[] {"ondoubleclick"}, "clickMethod", "form1", false, true, false, false);
        invoker.addEventListener("comp2", spec);
        invoker.addFormEventListener("form1", spec);
View Full Code Here

        spec.addEventListener("comp1", new String[] {"onclick"}, "testMethod", "form1", false, true, false, false);
        invoker.addEventListener("comp1", spec);
        invoker.addFormEventListener("form1", spec);
       
        spec.addEventListener("comp2", new String[] {"ondoubleclick"}, "clickMethod", "form1", false, true, false, false);
        invoker.addEventListener("comp2", spec);
        invoker.addFormEventListener("form1", spec);
       
        expect(cycle.isRewinding()).andReturn(false);
        expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
        expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
View Full Code Here

       
        IDirectEvent component = newMock(IDirectEvent.class);
        IComponentSpecification spec = new ComponentSpecification();
       
        // now test render
        invoker.addEventListener("comp1", spec);
        spec.addEventListener("comp1", new String[] {"onclick"}, "testMethod", "form1", false, false, false, false);
       
        expect(cycle.isRewinding()).andReturn(false);
       
        expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
View Full Code Here

       
        assertNotNull(worker.getElementScript());
        assertEquals(elemScript, worker.getElementScript().getPath());
       
        // now test render
        invoker.addEventListener("comp1", spec);
        spec.addEventListener("comp1", new String[] {"onclick"}, "testMethod", null, false, true, false, false);
        spec.addElementEventListener("elementId", new String[] {"onclick"}, "testMethod", null, false, true, false);
       
        /////////////////////////////////
       
View Full Code Here

       
        assertEquals(0, worker.getDefferedFormConnections().size());
       
        // test widget render
       
        invoker.addEventListener("wid1", widgetSpec);
        widgetSpec.addEventListener("wid1", new String[] {"onclick"}, "testMethod", null, false, true, false, false);
       
        checkOrder(cycle, false);
        expect(cycle.isRewinding()).andReturn(false);
        expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs).anyTimes();
View Full Code Here

        IDirectEvent comp2 = newMock(IDirectEvent.class);
        IComponentSpecification comp2Spec = new ComponentSpecification();
       
        // now test render
        spec.addEventListener("comp1", new String[] {"onclick", "onchange"}, "testMethod", "form1", true, true, false, false);
        invoker.addEventListener("comp1", spec);
        invoker.addFormEventListener("form1", spec);
       
        spec.addEventListener("comp2", new String[] {"onclick"}, "testAnotherMethod", "form1", true, true, false, false);
        invoker.addEventListener("comp2", spec);
        invoker.addFormEventListener("form1", spec);
View Full Code Here

        spec.addEventListener("comp1", new String[] {"onClick"}, "testFoo", null, false, false, false, false);

        IComponent comp = newComponent(spec, "comp1", "path/");
        IComponentEventInvoker invoker = newMock(IComponentEventInvoker.class);

        invoker.addEventListener("path/comp1", spec);

        replay();

        EventConnectionVisitor v = new EventConnectionVisitor();
        v.setEventInvoker(invoker);
View Full Code Here

        compEvents.put("comp1", p);
       
        expect(spec.getComponentEvents()).andReturn(compEvents);
        expect(spec.getElementEvents()).andReturn(Collections.EMPTY_MAP);

        invoker.addEventListener("path/comp1", spec);
        spec.rewireComponentId("comp1", "path/comp1");

        replay();

        EventConnectionVisitor v = new EventConnectionVisitor();
View Full Code Here

       
        assertNotNull(worker.getElementScript());
        assertEquals(elemScript, worker.getElementScript().getPath());
       
        // now test render
        invoker.addEventListener("comp1", spec);
        spec.addEventListener("comp1", new String[] {"onclick"}, "testMethod", null, false, true, false);
        spec.addElementEventListener("elementId", new String[] {"onclick"}, "testMethod", null, false, true, false);
       
        /////////////////////////////////
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.