Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in mmWizardForm
Message
From
21/04/2007 16:59:27
Walter Nicholls
Cornerstone Software Ltd
Auckland, New Zealand
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01217569
Message ID:
01218625
Views:
23
Wow thanks.. while I had imagined getting my name in the credits at some stage, I was contemplating something more substantial than a bug fix! Like writing up a tutorial for using the MS Report viewer linked to biz objs or something.

> beefing up samples ... next version

So, can the next version be released, like, yesterday ?
No, don't hurry on my account, get it right. Like most people I'm always eager to see the new stuff but most of the things I mentioned I've actually sussed enough to progress my project. (I haven't really tackled the "add new row" dialog yet, but I'm sure I can sort most of this with judicious use of bizobj.Cancel(), and a few key unbound controls.)

Regarding the wizards, the hacky thing I mentioned is related to the wizard logic relying on wizardpages.count to determine such things as when buttons are enabled.

I have just built a "reporting Wizard". the first page selects the report to be displayed, then, depending on which report is chosen, a second page is sometimes displayed to enter parameters for the report (eg filtering criteria). Thus the finish button is sometimes enabled for the first page, sometimes Next is. I've got this working by swapping WizardPages[1] in and out dynamically based on the report selection:
//edited down to show the point for clarity - this code would be very buggy!
protected override void btnNext_Click(object sender, EventArgs e)
{
    if (this.CurrentStep == 1) // Report selection page
    {
        if (selectedReport.HasParameterUI)
        {
            WizardPages[1] = selectedReport.GetParametersWizPage(this);
            CurrentStep = 2;
            ShowCurrentPage();
            btnPrevious.Enabled = true; // fix bug in mmWizardForm
        }
    }
}
and for completeness the first page's list selection
private void lstReport_SelectedIndexChanged(object sender, EventArgs e)
{
    // again this code is incomplete for clarity
    this.WizardForm.btnNext.Enabled = null!=oSelectedReport && oSelectedReport.HasParameterUI;
    this.WizardForm.btnFinish.Enabled = null!=oSelectedReport && ! oSelectedReport.HasParameterUI;
}
I don't suggest you rewrite anything just now, but when I wrote a wizardy framework in VFP, I gave each page a convenient way (SetWizardButtonsEnables() to enable or disable next/prev/finish buttons, and the page itself usually decided what the next page was. It wasn't perfect, and I got complaints from other programmers that it was too complicated, but that's probably because I'm the one that wrote the wizards with 20 steps!
Walter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform