Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Programmatically inserting Wizard pages Empty Programmatically inserting Wizard pages

Mon 30 Mar 2020 - 8:03
I have bog-standard, single-page wizard that collects information and creates rows on the Finish event. I need to extend this so that after completing all the fields in the wizard the user can either click 'Finish' to add the row and close the wizard or click 'Add Another Item' to dynamically insert a new page, pre-populated with their previous page's selections, allowing them to quickly build up a collection of similar objects that I can then write to the DB.
Does any of this sound possible or am I going to have to create a wizard with lots pages containing copies of the same controls, set the Finish button to Enabled=true from the start, and then handle writing the collection to the DB myself?
I can't seem to get access to any 'Pages'-type collection for the wizard and EnquiryForm.AddPageFlowRange doesn't seem to behave as expected so I'm a bit stumped.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Programmatically inserting Wizard pages Empty Re: Programmatically inserting Wizard pages

Mon 30 Mar 2020 - 8:03
Its possible but not easy. As you would have to directly manipulate the DataSet behind the Enquiry Form. This is untested so I dont know the results but I would say it could be done.

You would have to add a Page to the EnquiryForm.Enquiry.Source.Tables[“PAGES”]

You would have to add questions to the EnquiryForm.Enquiry.Source.Tables[“QUESTIONS”] theres a field call quPAGE which would have to be set to the name in the new PAGE you created.

Then you would have to add columns to the EnquiryForm.Enquiry.Source.Tables[“DATA”] where there name would match the question name. Each name must be uniques so you would have to set up some sort of naming convention e.g Name1, Name2 and so on.

EnquiryForm.Enquiry.Source.Tables[“DATA”].Columns.Add(“Test”); Quickest solution
Add a check box on your wizard and if they check it open the wizard again. You could pass the values you want to prepopulate in the KeyValueCollection and use the DefaultValue propery on the question.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Programmatically inserting Wizard pages Empty Re: Programmatically inserting Wizard pages

Mon 30 Mar 2020 - 8:04
It sounds like Occam wins again.
I'll give it a go, hopefully if I force the 'Disable Welcome Screen' field to true (is there a property for this?) the process won't be too disjointed
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Programmatically inserting Wizard pages Empty Re: Programmatically inserting Wizard pages

Mon 30 Mar 2020 - 8:04
protected override void PageChanged(object sender, FWBS.OMS.UI.Windows.PageChangedEventArgs e)
{ if (e.PageNumber == -1)

EnquiryForm.GotoPage(“PAGE10”,false); }

PAGE10 being your first page in the wizard.
Sponsored content

Programmatically inserting Wizard pages Empty Re: Programmatically inserting Wizard pages

Back to top
Permissions in this forum:
You cannot reply to topics in this forum