Package com.portal.app.cc.comp
Class PSaveManager
java.lang.Object
com.portal.app.cc.comp.PSaveManager
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
This class controls the data saving process for Customer Center. It
is primarily here to implement the implicit/explicit save mechanism
that occurs as a user modifies and then attempts to leave a page.
Depending on a system setting (processed by this class) the user may be prompted and given the option of saving changes before moving to the desired page. However, the setting may specify that the user should not be prompted in which case the save will happen automatically.
Depending on a system setting (processed by this class) the user may be prompted and given the option of saving changes before moving to the desired page. However, the setting may specify that the user should not be prompted in which case the save will happen automatically.
- Version:
- %version: 14 % %date_modified: Thu Jan 24 17:44:08 2002 %
- Author:
- kapono
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Displays an error message indicating that there was a failure during saving.boolean
displayErrorMessage
(String sCustErrorMsg) Displays an error message indicating that there was a failure during saving.static Component
findErrorComponent
(Component base, com.portal.app.util.CustomerValErrorData[] err, boolean checkAllComponents) For a passed-in array of model field descriptions, seeks those components with matching model field descriptions and marks them as being in error.void
Internal listener for changes to the property that determines if the user is queried before saving changes (when switching tabs).boolean
save
(PPageTemplate temp) Attempt to save the currently visible page in the givenPPageTemplate
.
-
Constructor Details
-
PSaveManager
public PSaveManager()Creates the save manager instance
-
-
Method Details
-
save
Attempt to save the currently visible page in the givenPPageTemplate
. The page is responsible for doing any error handling (for example, putting up an error message, marking a field associated with the error, etc.).- Parameters:
The
- template to save.- Returns:
true
if the save was successful or there was nothing to save. A return value offalse
means the CSR has requested to remain on the current page. (false
will be returned if the page on which the save attempt is being made throws aPSaveException
.)- See Also:
-
displayErrorMessage
public boolean displayErrorMessage()Displays an error message indicating that there was a failure during saving. The two options they can choose from are: "Discard Changes" and "Fix Errors".- Returns:
- true if the user selects the "Fix Errors" option; false otherwise
-
displayErrorMessage
Displays an error message indicating that there was a failure during saving. The two options they can choose from are: "Discard Changes" and "Fix Errors". The callers pass in a string of customer error message, which will be added to the front of the generic message. Pass in null or "" to display generic message only.- Parameters:
the
- customer error message- Returns:
- true if the user selects the "Fix Errors" option; false otherwise
-
propertyChange
Internal listener for changes to the property that determines if the user is queried before saving changes (when switching tabs).- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
e
- The property change event
-
findErrorComponent
public static Component findErrorComponent(Component base, com.portal.app.util.CustomerValErrorData[] err, boolean checkAllComponents) For a passed-in array of model field descriptions, seeks those components with matching model field descriptions and marks them as being in error. If at least one matching component is found, the last component found is returned; otherwise null is returned.- Parameters:
base
- Top-level component in which to start the searcherr
- Array of model field descriptionscheckAllComponents
- True to examine all components; false to check only dirty components- Returns:
- The last matching component, or null if no matching component is found
-