Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back button not disabling #1

Open
ekramer121 opened this issue Apr 2, 2018 · 4 comments
Open

Back button not disabling #1

ekramer121 opened this issue Apr 2, 2018 · 4 comments

Comments

@ekramer121
Copy link

ekramer121 commented Apr 2, 2018

Having an odd issue where I am attempting to toggle the enabled state of the back button when pages are shown but it doesn't seem to work. The back button is always enabled. The next button toggles just fine though.

// This works
this.advancedWizardControl.NextButtonEnabled = false;

// This does nothing.
this.advancedWizardControl.BackButtonEnabled = false;

Clarification Edit:

When a given page is shown, I set the backButtonEnabled setting to false. I am attempting to disable the Back and/or Next button depending on what options the user has selected.

@ekramer121
Copy link
Author

ekramer121 commented Apr 2, 2018

After cloning the repository and debugging I'm seeing a pattern.

with the following methods:

    private void wizardPage1_PageShow(object sender, WizardPageEventArgs e)
    {
        this.advancedWizard1.BackButtonEnabled = false;
    }

RuntimeWizardStrategy.SetButtonStates()
{...
...
...
if (_wizard.OnAMiddlePage())
{
_wizard.BackButtonEnabled = true;
_wizard.NextButtonEnabled = _wizard.NextButtonEnabledState;
_wizard.SetButtonText("_btnNext", _wizard.ReadNextText());
}
}

I navigate to the page in question the following happens.

  1. The RuntimeWizardStrategy.SetButtonStates() method fires, setting the BackButtonEnabled property to TRUE since it is a 'middle page'
  2. wizardPage1_PageShow fires... setting the BackButtonEnabled property to false.
  3. The wizard page's PageChanged event fires.
  4. The RuntimeWizardStrategy.SetButtonStates() method fires again, setting the BackButtonEnabled property to TRUE since it is a 'middle page'

This essentially overwriting my change to the Back button's enabled property.

@SteveBate
Copy link
Owner

Hi Ed,

I use the wizard in work projects (have done for years) and haven't seen that issue though it's probably down to the fact that not so long ago I attempted to "clean" the code somewhat and probably introduced it (no tests!) whilst my projects still use the old version.

Are you in a position to patch it and submit the change? I'm not going to get the chance to look at it this week at least due to "going live" on a project at work.

Cheers,

Steve

@ahmedhabib690
Copy link

Hi Steve,

I've using the wizard right now on one of my projects, and I have the same issue Ed is having, but I'm facing this issue with both Back & Next buttons. Setting the button enable to false in the PageChanged event is overwritten by the SetButtonStats() method.

Regards,
Ahmed

@ahmedhabib690
Copy link

After removing the enabling of the Next button in the SetButtonStats() at the middle page, it worked fine for me.

if (_wizard.OnAMiddlePage())
            {
                _wizard.BackButtonEnabled = true;
                //this line is removed
                //_wizard.NextButtonEnabled = _wizard.NextButtonEnabledState;
                _wizard.SetButtonText("_btnNext", _wizard.ReadNextText());
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants