Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James Drever 118 posts 149 karma points
    Aug 28, 2012 @ 16:19
    James Drever
    0

    Pre-submit workflows

    Taking up TimG's offer to listen to further suggestions for Contour 3, one area I'm currently struggling with Contour is with how to how do do a complex validation on a form before allowing it to be submitted.

    What I'm trying to do is to use the member tools functionality Tim introduced in http://www.nibble.be/?p=106 and http://www.nibble.be/?p=107 to generate membership registration and edting forms in Contour. It all works great, except that if the membership creation/editing in the Contour workflow fails for whatever reason, it is already too late to cancel the submitting of the form, and to return the user back to the form to make the required changes. The form just appears to the user to have completed successfully.   I can do some upfront checking via jquery (e.g. on existing usernames or emails) but I can't be absolutely sure when the Contour form has been submitted that the membership creation will work.

    Thought it was worth posting this here before creating a feature request, in case I'm being dumb and it is possible to do this.

  • Comment author was deleted

    Aug 30, 2012 @ 11:29

    Hey James,

    Thanks for the idea, what we'll do in Contour 3.0 with the razor render macro is make it possible to hook into the form validation (from a fieldtype and from an event handler so that should take care of the scenarion described here :) )

    Early preview of the razor render: http://www.screenr.com/Omf8

  • Comment author was deleted

    Aug 30, 2012 @ 11:56

    So should be something like: 

        public class ValidationTestApplicationBase
        {
            public ValidationTest()
            {
                Controllers.FormRenderController.FormValidate += new EventHandler<FormViewEventArgs>(FormRenderController_FormValidate);
            }
    
            void FormRenderController_FormValidate(object sender, FormViewEventArgs e)
            {
                ((Controller)sender).ModelState.AddModelError(string.Empty,"testing this");
            }
        }
  • James Drever 118 posts 149 karma points
    Aug 30, 2012 @ 12:21
    James Drever
    0

    Wow Tim, what a fantastic response.  I'll really look forward to testing 3.  The razor render looks really useful.  I know its intended for release later in the year, don't suppose you have a more definite release date yet?

  • Comment author was deleted

    Aug 30, 2012 @ 12:24

    Should be in oktober but nightly builds are already available http://nightly.umbraco.org/Umbraco%20Contour/ 

  • James Drever 118 posts 149 karma points
    Nov 09, 2012 @ 15:31
    James Drever
    0

    And now its released (in beta), and with a blog post to document it fully.  See http://www.nibble.be/?p=205 ; Fantastic!

Please Sign in or register to post replies

Write your reply to:

Draft