* Represents the state and behavior of a presentation independently of the GUI controls used in the interface.
* Represents the state and behavior of a presentation independently of the GUI controls used in the interface.
* Pulls the state and behavior of a view out into a model class that is part of the presentation.
* Pulls the state and behavior of a view out into a model class that is part of the presentation.
...
@@ -32,4 +31,22 @@ public interface PresentationModel {
...
@@ -32,4 +31,22 @@ public interface PresentationModel {
*/
*/
FieldModelgetFieldModel(StringfieldName);
FieldModelgetFieldModel(StringfieldName);
/**
* If errors are present on this PresentationModel.
* Returns true if at least one FieldModel has {@link BindingStatus#INVALID_SUBMITTED_VALUE invalid submitted values} or is {@link ValidationStatus#INVALID invalid}.
*/
booleanhasErrors();
/**
* Commit any {@link BindingStatus#DIRTY dirty} fields.
* @throws IllegalStateException if there are field models that have {@link BindingStatus#INVALID_SUBMITTED_VALUE invalid submitted values} or are {@link ValidationStatus#INVALID invalid}.
*/
voidcommit();
/**
* Validate all fields.
* Skips any fields with {@link BindingStatus#INVALID_SUBMITTED_VALUE invalid submitted values}.