Examples of TrackableComponentEventCallback


Examples of org.apache.tapestry5.TrackableComponentEventCallback

        // In many cases, the triggered element is a Form that needs to be able to
        // pass its event handler return values to the correct result processor.
        // This is certainly the case for forms.

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(interceptor);

        environment.push(ComponentEventResultProcessor.class, interceptor);
        environment.push(TrackableComponentEventCallback.class, callback);

        boolean handled = element
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

            return;
        }

        Page containerPage = cache.get(parameters.getContainingPageName());

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(resultProcessor);

        environment.push(ComponentEventResultProcessor.class, resultProcessor);
        environment.push(TrackableComponentEventCallback.class, callback);

        ComponentPageElement element = containerPage.getComponentElementByNestedId(parameters.getNestedComponentId());

        boolean handled = element.triggerContextEvent(parameters.getEventType(), parameters.getEventContext(), callback);

        if (!handled)
        {
            throw new TapestryException(String.format("Request event '%s' (on component %s) was not handled; you must provide a matching event handler method in the component or in one of its containers.", parameters.getEventType(), element.getCompleteId()), element,
                    null);
        }

        environment.pop(TrackableComponentEventCallback.class);
        environment.pop(ComponentEventResultProcessor.class);

        if (callback.isAborted())
        {
            callback.rethrow();
            return;
        }

        // If we get this far without generating a response, the default behavior is to
        // generate a redirect back to the active page; we can let the ComponentEventResultProcessor handle that.
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

        // In many cases, the triggered element is a Form that needs to be able to
        // pass its event handler return values to the correct result processor.
        // This is certainly the case for forms.

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(interceptor);

        environment.push(ComponentEventResultProcessor.class, interceptor);
        environment.push(TrackableComponentEventCallback.class, callback);

        boolean handled = element
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

                .getPageActivationContext(), resultProcessor))
            return;

        Page containerPage = cache.get(parameters.getContainingPageName());

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(resultProcessor);

        environment.push(ComponentEventResultProcessor.class, resultProcessor);
        environment.push(TrackableComponentEventCallback.class, callback);

        ComponentPageElement element = containerPage.getComponentElementByNestedId(parameters.getNestedComponentId());

        boolean handled = element
                .triggerContextEvent(parameters.getEventType(), parameters.getEventContext(), callback);

        if (!handled)
            throw new TapestryException(ServicesMessages.eventNotHandled(element, parameters.getEventType()), element,
                    null);

        environment.pop(TrackableComponentEventCallback.class);
        environment.pop(ComponentEventResultProcessor.class);

        if (callback.isAborted())
        {
            callback.rethrow();
            return;
        }

        if (!response.isCommitted())
            generator.generateResponse(activePage);
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

    @SuppressWarnings("unchecked")
    public boolean activatePage(ComponentResources pageResources, EventContext activationContext,
            ComponentEventResultProcessor resultProcessor) throws IOException
    {
        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(resultProcessor);

        pageResources.triggerContextEvent(EventConstants.ACTIVATE, activationContext, callback);

        if (callback.isAborted())
        {
            callback.rethrow();
            return true;
        }

        return false;
    }
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

        // In many cases, the triggered element is a Form that needs to be able to
        // pass its event handler return values to the correct result processor.
        // This is certainly the case for forms.

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(interceptor);

        environment.push(ComponentEventResultProcessor.class, interceptor);
        environment.push(TrackableComponentEventCallback.class, callback);

        boolean handled = element
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

            return;
        }

        Page containerPage = cache.get(parameters.getContainingPageName());

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(resultProcessor);

        environment.push(ComponentEventResultProcessor.class, resultProcessor);
        environment.push(TrackableComponentEventCallback.class, callback);

        ComponentPageElement element = containerPage.getComponentElementByNestedId(parameters.getNestedComponentId());

        boolean handled = element.triggerContextEvent(parameters.getEventType(), parameters.getEventContext(), callback);

        if (!handled)
        {
            throw new TapestryException(String.format("Request event '%s' (on component %s) was not handled; you must provide a matching event handler method in the component or in one of its containers.", parameters.getEventType(), element.getCompleteId()), element,
                    null);
        }

        environment.pop(TrackableComponentEventCallback.class);
        environment.pop(ComponentEventResultProcessor.class);

        if (callback.isAborted())
        {
            callback.rethrow();
            return;
        }

        // If we get this far without generating a response, the default behavior is to
        // generate a redirect back to the active page; we can let the ComponentEventResultProcessor handle that.
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

        // In many cases, the triggered element is a Form that needs to be able to
        // pass its event handler return values to the correct result processor.
        // This is certainly the case for forms.

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(interceptor);

        environment.push(ComponentEventResultProcessor.class, interceptor);
        environment.push(TrackableComponentEventCallback.class, callback);

        boolean handled = element
View Full Code Here

Examples of org.apache.tapestry5.TrackableComponentEventCallback

        // In many cases, the triggered element is a Form that needs to be able to
        // pass its event handler return values to the correct result processor.
        // This is certainly the case for forms.

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(interceptor);

        environment.push(ComponentEventResultProcessor.class, interceptor);
        environment.push(TrackableComponentEventCallback.class, callback);

        boolean handled = element
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.