Copied to clipboard

Flag this post as spam?

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


  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 05, 2013 @ 15:56
    Lee Kelleher
    0

    Contour CodeFirst for Multi-Page Form

    Hi Tim,

    I'm hitting an issue when trying to use Contour's CodeFirst for a multi-page/step form.

    The form data (pages, fieldsets, fields) all syncs from my code/class in the back-office no problem. I am able to preview the form (via the back-office), no problem.

    However on the front-end (using the 'Razor' macro), the form displays the first page okay - but pressing the 'Next' button, it reloads the first page again. It wont progress to the second page. :-(

    I've checked for JS errors, but nothing there. So next I tried to recreate the form without CodeFirst - added a couple of pages, each with a couple of fields. Then trying the manual form on the front-end, I can step through each page, no problems!


    I started to dig a little deeper - to see if it was a problem with my code/class. I exported both forms in the back-office (the CodeFirst generated one and the manual one). Then I compared the exported XML.

    The only major difference between them was that the CodeFirst generated one had the <Field>'s <SortOrder> and <PageIndex> values off-by-one. So that the first page had an index of '1' (instead of '0'). Not sure if that has an impact?


    Curious if you have had any issues with CodeFirst and multi-page forms?

    I'm using Contour v3.0.14 on Umbraco v6.1.2

    Thanks in advance,
    - Lee.

  • Comment author was deleted

    Aug 05, 2013 @ 16:04

    Ok thanks for the details will take a look

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 05, 2013 @ 16:12
    Lee Kelleher
    0

    Thanks Tim. I forgot to add that I'm using MVC render mode.

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 05, 2013 @ 16:41
    Lee Kelleher
    100

    I've figured it out!

    In my MVC view I had the Guid in uppercase, like so...

    @Umbraco.RenderMacro("umbracoContour.RazorRenderForm", new { FormGuid = "3E4D1653-E9CA-46D6-BFFD-6BA844B624FA" })
    

    I actually had the Guid as a string constant in my CodeFirst class.

    So while I was testing out the manually created forms, I'd noticed that their Guids were lowercase - so I switched mine to lowercase...

    @Umbraco.RenderMacro("umbracoContour.RazorRenderForm", new { FormGuid = "3e4d1653-e9ca-46d6-bffd-6ba844b624fa" })
    

    ... and Ta-dah! The multi-page/steps work fine now. :facepalm:

    At least I'll know this for future reference.

    Thanks,
    - Lee

  • Comment author was deleted

    Aug 05, 2013 @ 17:05

    Ah great it's working now :)

  • Martin Griffiths 826 posts 1269 karma points c-trib
    Sep 04, 2013 @ 10:35
    Martin Griffiths
    0

    I didnt think GUIDs were meant to be case sensitive???

    M.

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Sep 04, 2013 @ 10:40
    Lee Kelleher
    0

    @Martin - they aren't ... assumed they were being compared as strings.

  • Dan Waters 10 posts 30 karma points
    Sep 24, 2013 @ 13:03
    Dan Waters
    0

    Where did you learn how to create a multi step form with code first? I don't even know where to start :(

  • Comment author was deleted

    Sep 30, 2013 @ 13:06

    @Dan, it depends on the name you give your pages/fieldsets that will be used to create the different pages/fieldsets

Please Sign in or register to post replies

Write your reply to:

Draft