Package org.apache.tapestry5.internal.services

Examples of org.apache.tapestry5.internal.services.ComponentResultProcessorWrapper


     * event notification is what will ultimately render (typically, its a Block).  However, we do a <em>lot</em> of
     * tricks to provide the desired FormSupport around the what renders.
     */
    void onInject(EventContext context) throws IOException
    {
        ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
                componentEventResultProcessor);

        resources.triggerContextEvent(EventConstants.ACTION, context, callback);

        if (!callback.isAborted()) return;

        // Here's where it gets very, very tricky.

        final RenderCommand rootRenderCommand = pageRenderQueue.getRootRenderCommand();

View Full Code Here


        heartbeat.begin();

        try
        {
            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
                    componentEventResultProcessor);

            resources.triggerContextEvent(EventConstants.PREPARE_FOR_SUBMIT, context, callback);

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(EventConstants.PREPARE, context, callback);

            if (callback.isAborted()) return true;

            executeStoredActions();

            heartbeat.end();

            formSupport.executeDeferred();

            fireValidateFormEvent(context, callback);

            if (callback.isAborted()) return true;

            // Let the listeners know about overall success or failure. Most listeners fall into
            // one of those two camps.

            // If the tracker has no errors, then clear it of any input values
            // as well, so that the next page render will be "clean" and show
            // true persistent data, not value from the previous form submission.

            if (!tracker.getHasErrors())
                tracker.clear();

            resources.triggerContextEvent(tracker.getHasErrors() ? EventConstants.FAILURE : EventConstants.SUCCESS,
                                          context, callback);

            // Lastly, tell anyone whose interested that the form is completely submitted.

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(EventConstants.SUBMIT, context, callback);

            return callback.isAborted();
        }
        finally
        {
            environment.pop(Heartbeat.class);
            environment.pop(FormSupport.class);
View Full Code Here

     * event notification is what will ultimately render (typically, its a Block).  However, we do a <em>lot</em> of
     * tricks to provide the desired FormSupport around the what renders.
     */
    void onInject(EventContext context) throws IOException
    {
        ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
                componentEventResultProcessor);

        resources.triggerContextEvent(EventConstants.ACTION, context, callback);

        if (!callback.isAborted()) return;

        // Here's where it gets very, very tricky.

        final String formClientId = readParameterValue(FORM_CLIENTID_PARAMETER);

View Full Code Here

        if (uploadException != null)
        {
            Component page = componentSource.getPage(parameters.getActivePageName());

            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(resultProcessor);

            page.getComponentResources().triggerEvent(UploadEvents.UPLOAD_EXCEPTION, new Object[] { uploadException },
                                                      callback);

            // If an event handler exists and returns a value, then the callback will be aborted and a response
            // (typically a redirect) will already have been sent to the client.

            if (callback.isAborted()) return;

            // If the page does not properly handle the exception, then we throw it now.

            throw new RuntimeException(UploadMessages.unableToDecode(), uploadException);
        }
View Full Code Here

        heartbeat.begin();

        try
        {
            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
                    componentEventResultProcessor);

            resources.triggerContextEvent(PREPARE_FOR_SUBMIT, context, callback);

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(PREPARE, context, callback);

            if (callback.isAborted()) return true;

            executeStoredActions();

            heartbeat.end();

            ValidationTracker tracker = environment.peek(ValidationTracker.class);

            // Let the listeners peform any final validations

            // Update through the parameter because the tracker has almost certainly changed
            // internal state.

            this.tracker = tracker;

            formSupport.executeDeferred();

            fireValidateFormEvent(context, callback);

            if (callback.isAborted()) return true;

            // Let the listeners know about overall success or failure. Most listeners fall into
            // one of those two camps.

            // If the tracker has no errors, then clear it of any input values
            // as well, so that the next page render will be "clean" and show
            // true persistent data, not value from the previous form submission.

            if (!this.tracker.getHasErrors()) this.tracker.clear();

            resources.triggerContextEvent(tracker.getHasErrors() ? FAILURE : SUCCESS, context, callback);

            // Lastly, tell anyone whose interested that the form is completely submitted.

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(SUBMIT, context, callback);

            return callback.isAborted();
        }
        finally
        {
            environment.pop(Heartbeat.class);
            environment.pop(FormSupport.class);
View Full Code Here

     * event notification is what will ultimately render (typically, its a Block).  However, we do a <em>lot</em> of
     * tricks to provide the desired FormSupport around the what renders.
     */
    void onInject(EventContext context) throws IOException
    {
        ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
                componentEventResultProcessor);

        resources.triggerContextEvent(EventConstants.ACTION, context, callback);

        if (!callback.isAborted()) return;

        // Here's where it gets very, very tricky.

        final RenderCommand rootRenderCommand = pageRenderQueue.getRootRenderCommand();

View Full Code Here

        heartbeat.begin();

        try
        {
            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
                    componentEventResultProcessor);

            resources.triggerContextEvent(EventConstants.PREPARE_FOR_SUBMIT, context, callback);

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(EventConstants.PREPARE, context, callback);

            if (callback.isAborted()) return true;

            executeStoredActions();

            heartbeat.end();

            ValidationTracker tracker = environment.peek(ValidationTracker.class);

            // Let the listeners peform any final validations

            // Update through the parameter because the tracker has almost certainly changed
            // internal state.

            this.tracker = tracker;

            formSupport.executeDeferred();

            fireValidateFormEvent(context, callback);

            if (callback.isAborted()) return true;

            // Let the listeners know about overall success or failure. Most listeners fall into
            // one of those two camps.

            // If the tracker has no errors, then clear it of any input values
            // as well, so that the next page render will be "clean" and show
            // true persistent data, not value from the previous form submission.

            if (!this.tracker.getHasErrors()) this.tracker.clear();

            resources.triggerContextEvent(tracker.getHasErrors() ? EventConstants.FAILURE : EventConstants.SUCCESS,
                                          context, callback);

            // Lastly, tell anyone whose interested that the form is completely submitted.

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(EventConstants.SUBMIT, context, callback);

            return callback.isAborted();
        }
        finally
        {
            environment.pop(Heartbeat.class);
            environment.pop(FormSupport.class);
View Full Code Here

        if (uploadException != null)
        {
            Component page = componentSource.getPage(parameters.getActivePageName());

            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(resultProcessor);

            page.getComponentResources().triggerEvent(UploadEvents.UPLOAD_EXCEPTION, new Object[] { uploadException },
                                                      callback);

            // If an event handler exists and returns a value, then the callback will be aborted and a response
            // (typically a redirect) will already have been sent to the client.

            if (callback.isAborted()) return;

            // If the page does not properly handle the exception, then we throw it now.

            throw new RuntimeException(UploadMessages.unableToDecode(), uploadException);
        }
View Full Code Here

        if (uploadException != null)
        {
            Component page = componentSource.getPage(parameters.getActivePageName());

            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(resultProcessor);

            page.getComponentResources().triggerEvent(UploadEvents.UPLOAD_EXCEPTION, new Object[] { uploadException },
                                                      callback);

            // If an event handler exists and returns a value, then the callback will be aborted and a response
            // (typically a redirect) will already have been sent to the client.

            if (callback.isAborted()) return;

            // If the page does not properly handle the exception, then we throw it now.

            throw new RuntimeException(UploadMessages.unableToDecode(), uploadException);
        }
View Full Code Here

        heartbeat.begin();

        try
        {
            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
                    componentEventResultProcessor);

            resources.triggerContextEvent(EventConstants.PREPARE_FOR_SUBMIT, context, callback);

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(EventConstants.PREPARE, context, callback);

            if (callback.isAborted()) return true;

            executeStoredActions();

            heartbeat.end();

            formSupport.executeDeferred();

            fireValidateFormEvent(context, callback);

            if (callback.isAborted()) return true;

            // Let the listeners know about overall success or failure. Most listeners fall into
            // one of those two camps.

            // If the tracker has no errors, then clear it of any input values
            // as well, so that the next page render will be "clean" and show
            // true persistent data, not value from the previous form submission.

            if (!tracker.getHasErrors())
                tracker.clear();

            resources.triggerContextEvent(tracker.getHasErrors() ? EventConstants.FAILURE : EventConstants.SUCCESS,
                                          context, callback);

            // Lastly, tell anyone whose interested that the form is completely submitted.

            if (callback.isAborted()) return true;

            resources.triggerContextEvent(EventConstants.SUBMIT, context, callback);

            return callback.isAborted();
        }
        finally
        {
            environment.pop(Heartbeat.class);
            environment.pop(FormSupport.class);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.internal.services.ComponentResultProcessorWrapper

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.