com.sssw.rt.util
Class AgoInvalidDataException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--com.sssw.rt.util.AgoException
|
+--com.sssw.rt.util.AgoApiException
|
+--com.sssw.rt.util.AgoDataException
|
+--com.sssw.rt.util.AgoInvalidDataException
- All Implemented Interfaces:
- AgiParentedException, Serializable
- public class AgoInvalidDataException
- extends AgoDataException
The subclass of AgoDataException that indicates that
the row validation expression on a table being updated
failed to validate the supplied data.
Example:
// This code attached to a save button on a form checks to see if data in
// the dataset has changed, and if so, updates the data source.
try {
// If any data changed
if (agData.haveRowsChanged()) {
agData.updateRows();
}
}
catch (AgoInvalidDataException e) {
// A user value entered in the form failed the validation test for
// the table. Tell the user.
agGeneral.showMessage ("Error", "Invalid data entered in the form. Please try again.");
}
- See Also:
- Serialized Form
Method Summary |
String |
getFieldName()
Returns the name of the required field whose invalid data resulted in the exception. |
void |
setFieldName(String f)
Sets the name of the field whose data is invalid. |
Methods inherited from class com.sssw.rt.util.AgoException |
copyTo,
getExceptionHTML,
getExceptionMessage,
getExceptionMessage,
getHTML,
getMessage,
getMessage,
getParentException,
printStackTrace,
printStackTrace,
printStackTrace,
setHTML |
AgoInvalidDataException
public AgoInvalidDataException()
getFieldName
public String getFieldName()
- Returns the name of the required field whose invalid data resulted in the exception.
- Example:
try {
agData.updateRows();
}
catch (AgoInvalidDataException e) {
String fieldName = e.getFieldName();
agGeneral.showMessage ("Error", "Invalid data entered in field "+fieldName+". Please try again.");
}
- See Also:
AgoInvalidDataException.setFieldName(String)
setFieldName
public void setFieldName(String f)
- Sets the name of the field whose data is invalid.
- Parameters:
f
- the name of the field whose data is invalid- Example:
e.setFieldName ("myField");
- See Also:
AgoInvalidDataException.getFieldName()