Package org.apache.tapestry

Examples of org.apache.tapestry.IDirectEvent


        IPage componentPage = componentPageName == null ? page : cycle.getPage(componentPageName);

        IComponent component = componentPage.getNestedComponent(componentId);

        IDirectEvent direct = null;

        try
        {
            direct = (IDirectEvent) component;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(EngineMessages.wrongComponentType(
                    component,
                    IDirectEvent.class), component, null, ex);
        }

        // Check for a StaleSession only when the session was stateful when
        // the link was created.

        if (activeSession && direct.isStateful())
        {
            WebSession session = _request.getSession(false);

            if (session == null || session.isNew())
                throw new StaleSessionException(EngineMessages.requestStateSession(direct),
View Full Code Here


    }

    public void testGetLinkOnSamePage()
    {
        IPage page = newPage("ThePage");
        IDirectEvent c = newDirect();
        IRequestCycle cycle = newCycle();
        WebRequest request = newWebRequest(false, null);
        LinkFactory lf = newLinkFactory();
        ILink link = newLink();
View Full Code Here

    }

    public void testGetLinkOnSamePageForPost()
    {
        IPage page = newPage("ThePage");
        IDirectEvent c = newDirect();
        IRequestCycle cycle = newCycle();
        WebRequest request = newWebRequest(false, null);
        LinkFactory lf = newLinkFactory();
        ILink link = newLink();
View Full Code Here

    }

    public void testGetLinkOnSamePageStateful()
    {
        IPage page = newPage("ThePage");
        IDirectEvent c = newDirect();
        IRequestCycle cycle = newCycle();
        WebSession session = newWebSession();
        WebRequest request = newWebRequest(false, session);
        LinkFactory lf = newLinkFactory();
        ILink link = newLink();
View Full Code Here

    public void testGetLinkOnDifferentPage()
    {
        IPage page = newPage("ActivePage");
        IPage componentPage = newPage("ComponentPage");
        IDirectEvent c = newDirect();
        IRequestCycle cycle = newCycle();
        WebRequest request = newWebRequest(false, null);
        LinkFactory lf = newLinkFactory();
        ILink link = newLink();
View Full Code Here

    public void testServiceSimple() throws Exception
    {
        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirectEvent d = newDirect();
        LinkFactory lf = newLinkFactory();
        ResponseRenderer rr = newResponseRenderer();

        trainGetParameter(cycle, ServiceConstants.COMPONENT, "fred.barney");
        trainGetParameter(cycle, ServiceConstants.CONTAINER, null);
        trainGetParameter(cycle, ServiceConstants.PAGE, "ActivePage");
        trainGetParameter(cycle, ServiceConstants.SESSION, null);

        trainGetPage(cycle, "ActivePage", page);
        cycle.activate(page);

        trainGetNestedComponent(page, "fred.barney", d);

        trainExtractListenerParameters(lf, cycle, parameters);

        trainExtractBrowserEvent(cycle);
       
        cycle.setListenerParameters(isA(Object[].class));
       
        d.triggerEvent(eq(cycle), isA(BrowserEvent.class));
       
        rr.renderResponse(cycle);
       
        replay();
View Full Code Here

    {
        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IPage componentPage = newPage();
        IDirectEvent d = newDirect();
        LinkFactory lf = newLinkFactory();
        ResponseRenderer rr = newResponseRenderer();

        trainGetParameter(cycle, ServiceConstants.COMPONENT, "fred.barney");
        trainGetParameter(cycle, ServiceConstants.CONTAINER, "ComponentPage");
        trainGetParameter(cycle, ServiceConstants.PAGE, "ActivePage");
        trainGetParameter(cycle, ServiceConstants.SESSION, null);

        trainGetPage(cycle, "ActivePage", page);

        cycle.activate(page);

        trainGetPage(cycle, "ComponentPage", componentPage);

        trainGetNestedComponent(componentPage, "fred.barney", d);

        trainExtractListenerParameters(lf, cycle, parameters);

        trainExtractBrowserEvent(cycle);
       
        cycle.setListenerParameters(isA(Object[].class));
       
        d.triggerEvent(eq(cycle), isA(BrowserEvent.class));

        rr.renderResponse(cycle);

        replay();
View Full Code Here

    public void testSessionActiveAndRequired() throws Exception
    {
        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirectEvent d = newDirect();
       
        LinkFactory lf = newLinkFactory();
        ResponseRenderer rr = newResponseRenderer();
       
        trainGetParameter(cycle, ServiceConstants.COMPONENT, "fred.barney");
        trainGetParameter(cycle, ServiceConstants.CONTAINER, null);
        trainGetParameter(cycle, ServiceConstants.PAGE, "ActivePage");
        trainGetParameter(cycle, ServiceConstants.SESSION, "T");
       
        trainGetPage(cycle, "ActivePage", page);
        cycle.activate(page);

        trainGetNestedComponent(page, "fred.barney", d);

        trainIsStateful(d, true);

        WebSession session = newWebSession(false);
        WebRequest request = newWebRequest(session);
       
        trainExtractListenerParameters(lf, cycle, parameters);

        trainExtractBrowserEvent(cycle);
       
        cycle.setListenerParameters(isA(Object[].class));
       
        d.triggerEvent(eq(cycle), isA(BrowserEvent.class));

        rr.renderResponse(cycle);

        replay();
View Full Code Here

   
    public void testStaleSession() throws Exception
    {
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirectEvent d = newDirect();
       
        Location l = newLocation();

        trainGetParameter(cycle, ServiceConstants.COMPONENT, "fred.barney");
        trainGetParameter(cycle, ServiceConstants.CONTAINER, null);
View Full Code Here

    public void testNoBrowserEvent() throws Exception
    {
        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirectEvent d = newDirect();
        LinkFactory lf = newLinkFactory();
        ResponseRenderer rr = newResponseRenderer();

        trainGetParameter(cycle, ServiceConstants.COMPONENT, "fred.barney");
        trainGetParameter(cycle, ServiceConstants.CONTAINER, null);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IDirectEvent

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.