Wizard

Aug 10, 2010 at 11:40 AM
My field generation is coming along well but I have hit a new issue so wondered if anyone has thought about somehow splitting the questions over a number of pages mainly because my form is now getting quite long. Was thinking of a step wizard or tabs unless you have any other or better suggestions. Look forward to thoughts and possible solutions.
Aug 11, 2010 at 12:51 AM
We could add the notions of pages to the form object, although there is already a set of methods on the base Field object that could help with this: AddDataValue() and GetDataValue(). These methods allow you to attach any arbitrary objects to your fields for any purpose. These arbitrary objects are retrieved using a key of type string. You could call myField.AddDataValue("page",1) for all of the fields that you wanted to show on the first page or wizard step, myField.AddDataValue("page",2) for the 2nd page, etc. This would allow you to group them, which leads me to another thing that is already put in place: the Group property on the base Field object. It's just a string property that lets you group the fields for any purpose, such as paging. These 2 approaches would let you achieve what you need, I think. But, maybe a new Page property of type int could be implemented for this purpose. What do you think?
Aug 11, 2010 at 3:30 AM
I forgot to mention that at this time, you would have to render the fields manually, by iterating through the fields to render and calling RenderHTML(). A fix for this would be to add an overload of the Form.Render() method that accepts a predicate to weed out the fields that you don't want to render. I'll see about this soon. Code contributions are welcome, as well.
Jul 7, 2011 at 8:59 PM
Edited Jul 8, 2011 at 7:27 PM

Hi Shamen, Did you ever achieve this?

Edtit: I found a solution.. although i cant figure out how to attach it on the forum

Jul 12, 2011 at 10:37 AM

No, haven't had a chance to get to it yet. Keen to see your solution though

Jul 12, 2011 at 1:52 PM

Put it up on http://pastebin.com/ and link to it here.

Jul 26, 2011 at 10:15 PM

Sorry forgot to check the "send email box".. i will upload the files in a bit..

Jul 26, 2011 at 11:36 PM

I put up the files on yousendit, let me know if its helpfull https://www.yousendit.com/download/cnJnc2ZORkVlcEkwTVE9PQ