user1168608
user1168608

Reputation: 618

How to override next button event of JFace wizard

I have a wizard comprising of three pages page1 , page2, page3.

I'm in page 2 and I press "Next" button , where some validations for duplicate creation needs to verified based on inputs form page1 and a selection inputs entered in page2.

Which method should i override inorder to include my validations and pop up a message box(complaining about duplicacy) on click of Next button of page2.

Upvotes: 3

Views: 1087

Answers (1)

greg-449
greg-449

Reputation: 111142

You can override WizardPage.getNextPage() and return null to prevent the next button from operating.

It is more usual to validate the user input as it happens and call WizardPage.setPageComplete(false) to disable the next button completely until the page is valid.

Call WizardPage.setErrorMessage(msg) or WizardPage.setMessage(msg, type) to display messages.

Upvotes: 6

Related Questions