Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jun 02, 2010 @ 10:00
    Ismail Mayat
    1

    Multipage form current page

    Hello,

    I have a multi step form, i want to create a field type that will show all steps above the form and highlight current step that user is one e.g:

    1. Your details   2. Your Request  3. Finally

    I will render out as ul li and put selected class if on current step.  However my question is there a way to determine (something in session?) which step you are currently on?

    Regards

    Ismail

  • Harald Ulriksen 207 posts 249 karma points
    Jun 02, 2010 @ 12:00
    Harald Ulriksen
    1

    One way (it might be a simpler one) is to inherit or wrap the contour form in your own user control.

    If you look in the RenderForm.ascx markup you'll see that each fieldSet has a literal control in the cssClass definitions which add's the current page/section name to the cssClass. You can access this by looking into the controls collection of the contour control by looping or using FindControl.

    When you got the name of the page/section you can open up the form definition form the API and determine the page based on the page name matching the text of the literal control. Note that if the page has a space in the name you will need to convert it the same way as contour does.

    Hope this helps,
    Harald.

  • Harald Ulriksen 207 posts 249 karma points
    Jun 02, 2010 @ 12:04
    Harald Ulriksen
    1

    Do note that this will not be a field type. However, making it a field type also means that it will have to be saved as an entry to the form - which I can't really see makes any sense, but that might just be me.

    Cheers,
    Harald.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jun 02, 2010 @ 12:55
    Ismail Mayat
    0

    Harald,

    Thought it would involve using your nice little wrapper technique.  I was hoping there was something in session or viewstate to tell you current page, I know doc2form sticks current page in view state and updates as you move along.

    Regards

    Ismail

  • Harald Ulriksen 207 posts 249 karma points
    Jun 02, 2010 @ 13:31
    Harald Ulriksen
    1

    Got another suggestion, which does not involve a wrapper :-) or inheriting the form.  I'm using this technique to get the ID of a newly created contour record, but current page might be possibe if the workflow event partially submitted (or any other workflow even) fire for each page.

    You can make a workflowtype and get the current page from e.record.CurrentPage, save it to the httpContext.items collection (sessions is not request specific and will get you in trouble). You can then make a user control which reads the current page from the items collection again.  

     H.

     

  • Harald Ulriksen 207 posts 249 karma points
    Jun 02, 2010 @ 13:52
    Harald Ulriksen
    0

    Hm, not sure what's happening. With version 1.0.9.1 it works moving forward, the PartiallySubmitted is triggered for each page change. However moving backwards doesn't work. With 2 page form the resume event doesn't trigger at all, with 3 page form it doesn't trigger the first time the previous button is clicked, the second... n'th time however the event is triggered properly.I.e. going backwards from page 3 the event is triggered on page 1. Going backward from page 4 the even is triggered from page 2 and 1.

    Not sure if this is fixed in version 1.0.10

    If you choose to inherit the RenderForm instead of wrapping it you can overried the button clicks and set current page directly in context.items collection. Guess that's my best suggestion for now.

    H.

  • Harald Ulriksen 207 posts 249 karma points
    Jun 02, 2010 @ 14:05
    Harald Ulriksen
    0

    Behaviour in 1.0.10 is the same as in 1.0.9.1.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 05, 2010 @ 17:02
    Ismail Mayat
    1

    Harald,

    I have managed to hack something together for this that works see here I make use of inheritance.

    Regards

    Ismail

  • Folkert 82 posts 212 karma points
    Jul 05, 2010 @ 17:05
    Folkert
    1

    May be a friendly client side solution which I discovered last week:

    http://tympanus.net/Tutorials/FancySlidingForm/

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 05, 2010 @ 17:16
    Ismail Mayat
    0

    Folkert,

    That is freaking awesome many thanks i reckon i can have some fun with that.  Not with current project as the form is linear step where each step has mandatory fields.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft