Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Validating input in a WizardPage

Does anyone have a simple example of validating the input for a text field
in a org.eclipse.jface.wizard.WizardPage? (To prevent the user from going to the next page)

The example I am following is

http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html

Is this typically how it is done in Jazz?

0 votes



2 answers

Permanent link
Does anyone have a simple example of validating the input for a text
field
in a org.eclipse.jface.wizard.WizardPage? (To prevent the user from
going to the next page)

You may want to take a look at WizardPage#canFlipToNextPage():


/**
* The <code>WizardPage</code> implementation of this
<code>IWizardPage</code>
* method returns <code>true</code> if this page is complete
(<code>isPageComplete</code>)
* and there is a next page to flip to. Subclasses may override
(extend or reimplement).
*
* @see #getNextPage
* @see #isPageComplete()
*/
public boolean canFlipToNextPage() {
return isPageComplete() && getNextPage() != null;
}

--
Regards,
Patrick
Jazz Work Item Team

0 votes


Permanent link
Thank you!

I did 2 things.

In the example, the author has the WizardPage implement Listener.
I use handleEvent() to display Messages to the user
via setMessage() and setErrorMessage(). Also in handleEvent(), I call

getWizard().getContainer().updateButtons()


I am using canFlipToNextPage() to validate the page in my 1st 2 wizard pages. In my last page, canFlipToNextPage() should be false because there is not a next page.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,939

Question asked: Apr 05 '10, 7:49 p.m.

Question was seen: 10,159 times

Last updated: Apr 05 '10, 7:49 p.m.

Confirmation Cancel Confirm