Interface WizardValidationManager
- All Known Implementing Classes:
PAccountCreationWizard
,PPurchaseOfferingWizard
,PValidatingWizard
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Value indicating that the user wishes to fix a validation errorstatic final int
Value indicating that the user wishes to ignore a validation error.static final int
Value indicating that no matching error field was found. -
Method Summary
Modifier and TypeMethodDescriptionvoid
displayCommitError
(String str, Component comp) Puts up a simple commit-time error message.void
displayMessage
(String str, String title, int messageType, String property) Puts up a simple message with a dismiss button unless the message has been flagged as wanting to be ingnored.int
displayYesNoMessage
(String str, String title, int messageType, String property) Puts up a Yes/No message and returns a value corresponding to the way the message is dismissed unless the message has been flagged as wanting to be ingnored.int
Puts up a validate-time error message and returns aJOptionPane
value corresponding to the way the error message is dismissed.boolean
handleCommitError
(com.portal.app.util.CustomerError customerError, Component comp) Alerts the user if the passed in component is capable of handling the passed-in commit-time error.int
handleValidateError
(com.portal.app.util.CustomerError customerError, Component comp, boolean alertOnlyIfMatch) Handles a validation error on the current page and returns information about the user's response.validateModel
(PModelHandle model) Validates the model handle passed in using default validation.void
Collects data from the currently visible page and validates it using default validation.
-
Field Details
-
VALIDATION_NOMATCH
static final int VALIDATION_NOMATCHValue indicating that no matching error field was found.- See Also:
-
VALIDATION_IGNOREERROR
static final int VALIDATION_IGNOREERRORValue indicating that the user wishes to ignore a validation error.- See Also:
-
VALIDATION_FIXERROR
static final int VALIDATION_FIXERRORValue indicating that the user wishes to fix a validation error- See Also:
-
-
Method Details
-
validatePage
Collects data from the currently visible page and validates it using default validation. If an error is encountered, then if it contains enough information to auto-locate the field associated with the error, the field is marked. If there is error text associated with the error, it is displayed in a message box. If there is no error text associated with the error, a generic validation error message is displayed. If the user elects to fix the error then this method throws aPValidationException
.The wizard framework will call
validateWizardPage
on a page at page-switch time. If the page wishes to it can have the validation manager do default validation on the page by calling this method.- Throws:
PValidationException
- See Also:
-
validateModel
Validates the model handle passed in using default validation.The wizard framework will call
validateWizardPage
on a page at page-switch time. If the page wishes to it can do its own data collection but have the validation manager do default validation of the model handle by calling this method. The page itself can then analyze and act upon any returned error and/or it can have the validation manager handle the error.- Parameters:
model
- Model handle to be validated.- Returns:
CustomerError
if the validation failed, otherwisenull
.- Throws:
RemoteException
- See Also:
-
handleValidateError
int handleValidateError(com.portal.app.util.CustomerError customerError, Component comp, boolean alertOnlyIfMatch) Handles a validation error on the current page and returns information about the user's response. If the error passed in has sufficient information to auto-locate the field associated with the error, the field is marked. If there is error text associated with the error passed in, it is displayed in a message box. If there isn't any error information passed in, a generic validation error message is displayed.
If thealertOnlyIfMatch
flag is set, then only if a field matching the error is found will an error message be displayed.The wizard framework will call
validateWizardPage
on a page at page-switch time. If the page wishes to it can do its own data collection and error determination. The page can then call this method on the validation manager to handle the error.- Parameters:
customerError
- A customer error object describing the error.comp
- TheComponent
in which to start the search for the error.alertOnlyIfMatch
- Seereturn
description.- Returns:
VALIDATION_IGNOREERROR
if the user chooses to ignore the validation error orVALIDATION_FIXERROR
if the user chooses to fix the error. If thealertOnlyIfMatch
flag is set, then if no matching error field is foundVALIDATION_NOMATCH
is returned.- See Also:
-
displayYesNoValidateError
Puts up a validate-time error message and returns aJOptionPane
value corresponding to the way the error message is dismissed.- Parameters:
str
- The error string to be displayed.- Returns:
JOptionPane.YES_OPTION
,JOptionPane.NO_OPTION
, orJOptionPane.CLOSED_OPTION
depending on the user action.
-
handleCommitError
Alerts the user if the passed in component is capable of handling the passed-in commit-time error. If the error passed in has sufficient information to auto-locate the field associated with the error, the field is marked and if there is error text associated with the error, it is displayed in a message box or if there is no error text then a generic message is displayed.
The wizard framework will successively callhandleWizardCommitError
on each page after a commit-time failure until a page claims the error. If the page wishes to it can call this method on the validation manager to do default error determination.- Parameters:
customerError
- A customer error object describing the error.comp
- TheComponent
in which to start the search for the error. If the auto-locate search attempt is successful, the (top-level) wizard page containingcomp
is switched to before the error message is displayed.- Returns:
true
if a message has been displayed indicating that the page is capable of handling the error; otherwisefalse
.- See Also:
-
displayCommitError
Puts up a simple commit-time error message.- Parameters:
str
- The error string to be displayed. If the string isnull
, a default commit failure message is displayed.comp
- The (top-level) wizard page containingcomp
will be switched to before the error is displayed. Ifnull
, no page switch will occur.
-
displayYesNoMessage
Puts up a Yes/No message and returns a value corresponding to the way the message is dismissed unless the message has been flagged as wanting to be ingnored. (The dialog can be made to contain a "Don't remind me again" checkbox.property
is used to track whether the user wishes to see the message box again.)- Parameters:
str
- Message to display.title
- Message box title.messageType
- AJOptionPane
message type.property
- Ifnull
the message is displayed in a normal message dialog. If non-null
the message is displayed in aPDisplayOnRequestOptionMsgDlg
.- Returns:
- If
property
isnull
,
JOptionPane.YES_OPTION
,JOptionPane.NO_OPTION
, orJOptionPane.CLOSED_OPTION
is returned depending on the user action. Ifproperty
is non-null
,
PDisplayOnRequestOptionMsgDlg.HIDE_DIALOG
is another possible return value.
- See Also:
-
displayMessage
Puts up a simple message with a dismiss button unless the message has been flagged as wanting to be ingnored. (The dialog can be made to contain a "Don't remind me again" checkbox.property
is used to track whether the user wishes to see the message box again.)- Parameters:
str
- The message to display. If the string isnull
, a default validation failure message is displayed.title
- The title to be displayed. If the string isnull
, a default validation failure title is displayed.messageType
- AJOptionPane
message type.property
- Ifnull
the message is displayed in a normal message dialog. If non-null
the message is displayed in aPDisplayOnRequestOptionMsgDlg
.- See Also:
-