3

Is there any way of adding a Validator to the last page in ControlsFX Wizards?

I am currently using the following on the last page :

    public void onEnteringPage(Wizard wizard) {
            wizard.getValidationSupport().registerValidator(cb, 
            Validator.createEmptyValidator("The instance field is mandatory"));

But since this is the last page I am still able to click finish when the cb(choice box) is empty.

miniHessel
  • 778
  • 4
  • 15
  • 39

1 Answers1

1

I had the same problem.

I think this is due to a bug in version 8.40.9 of ControlsFX where they forgot to check the FINISH Button against the invalid property, too.

Look here in the Issue Issue 521 at line 633. They have added the necessary call. Just wait for the next update, when the issue will be merged.

For a quick and dirty workaround just add another pane to your wizard. With a text "Finished" for example, because on the "next" buttons the validation works.

Parker
  • 7,244
  • 12
  • 70
  • 92
Felix S.
  • 126
  • 4