[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disable "Finish" button in wizardpage

I believe isPageComplete() will disable both the Next and Finish buttons.
What he wants to do is disable only Finish until the last page. Which I
think he can do by overriding canFinish() on preceding pages and returning
false. I think by "does absolutely nothing" he means the result of
canFinish() has no effect on the Finish button. To which I would echo
Christopher Elke. Let's see the code.

Bob

"Lenny Hoffman" <lennyhoffman@xxxxxxxxxxxxx> wrote in message
news:ajcgqc$mc6$1@xxxxxxxxxxxxxxxx
> Hi Sang,
>
> The default canFinish returns true only if all wizard pages have their
> isPageCompete set.  If pages subsequent to the one being completed are not
> complete, thus finish should not be enabled, then make sure that their
> isPageComplete setting is false, and only set them true upon their getting
> completed.
>
> Regards,
>
> Lenny
>
> "Sang" <sangl@xxxxxxxxx> wrote in message
news:ajcadj$k4d$1@xxxxxxxxxxxxxxxx
> > Hi Bob,
> >
> > You didn't get my point.  canFinish() does absolutely nothing and
> > isPageComplete() disable both the "Next" and "Finish()" buttons. This
kind
> > of behavior is not what I expect.  I would like the Next button to be
> > enabled so the user can go to Next page, meanwhile, I would like the
> > Finish button to be disabled so the user cannot finish the wizard in the
> > middle of the process.
> >
> > Bob Foster wrote:
> >
> > > Then as Simon says check to make sure your canFinish is being called.
> >
> > > Bob
> >
> > > "Sang" <sangl@xxxxxxxxx> wrote in message
> news:ajbe2l$74p$1@xxxxxxxxxxxxxxxx
> > > > I only want the \"Finish\" button to be enabled at the very last
> > > > wizard-page. However, if I call setPageComplete(true) to enable the
> > > > \"Finish\" button and press button \"Back\", then the \"Finish\"
> button is
> > > > enabled and the user can exit the wizard in the middle of the
process.
> > > > This is not what I intend to do.  I only allow the user to exit the
> wizard
> > > > when all the required steps are properly carried out.
> > > >
> > > > Sang wrote:
> > > >
> > > > > Return false in canFinish() does not dim out/disable the Finish
> button.
> > > > > Anything that I may have missed?
> > > >
> > > > > Bob Foster wrote:
> > > >
> > > > > > If you look at existing pages, you will see that many of them
are
> > > > structured
> > > > > > as follows:
> > > >
> > > > > > A single \"validate\" method checks the values of all fields in
> the
> > > page,
> > > > > > produces messages about them and calls setPageComplete().
Validate
> is
> > > > called
> > > > > > at the end of createControl() and at the end of any listener
> action.
> > > (Since
> > > > > > it is bad UI to show an error message when the user initially
> visits a
> > > > page,
> > > > > > createControl() clears messages after calling validate.) Thus,
> Finish
> > > and
> > > > > > Next are never enabled unless the page is valid.
> > > >
> > > > > > There can be exceptions to this behavior, e.g., if there are two
> > > fields in
> > > > > > an error state it is best to complain about the one the user
just
> > > changed,
> > > > > > but in general this is a tried-and-true technique.
> > > >
> > > > > > Bob
> > > >
> > > > > > \"Simon Arsenault\" <simon_arsenault@xxxxxxxxxxxxxx> wrote in
> message
> > > > > > news:aj0qqk$tm2$1@xxxxxxxxxxxxxxxx
> > > > > > > IWizard.canFinish()
> > > > > > >
> > > > > > > Look at the implementation for Wizard.canFinish()  It asks
each
> page
> > > > > > > isPageComplete() and if so, returns true. You can override
this
> > > method or
> > > > > > > make sure you pages return false for isPageComplete() until
the
> user
> > > has
> > > > > > > entered the correct information.
> > > > > > >
> > > > > > > Simon :-)
> > > > > > >
> > > > > > > \"Sang\" <j_sklam@xxxxxxxxxxx> wrote in message
> > > > > > > news:aj0qfp$tgb$1@xxxxxxxxxxxxxxxx
> > > > > > > > Does anyone know how to disable the \"Finish\" button in a
> > > wizardpage?
> > > > > > > > I do not want the user from existing the wizard dialog
without
> > > > > > > > completing the steps required.  Thanks
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> >
> >
> >
> >
>
>