Search in sources :

Example 6 with IDataModel

use of org.jowidgets.cap.ui.api.model.IDataModel in project jo-client-platform by jo-source.

the class BeanRelationTreeModelImpl method createValidationResult.

@Override
public IValidationResult createValidationResult() {
    final IValidationResultBuilder builder = ValidationResult.builder();
    builder.addResult(root.validate());
    for (final Object relationModelObject : relationNodes.values()) {
        final IBeanRelationNodeModel<?, ?> relationModel = (IBeanRelationNodeModel<?, ?>) relationModelObject;
        builder.addResult(relationModel.validate());
    }
    for (final IDataModel dataModel : externalDataModels) {
        builder.addResult(dataModel.validate());
    }
    return builder.build();
}
Also used : IBeanRelationNodeModel(org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel) IValidationResultBuilder(org.jowidgets.validation.IValidationResultBuilder) IDataModel(org.jowidgets.cap.ui.api.model.IDataModel)

Example 7 with IDataModel

use of org.jowidgets.cap.ui.api.model.IDataModel in project jo-client-platform by jo-source.

the class DataModelContextImpl method doSave.

private void doSave(final ChangeResponseImpl changeRespose, final ICallback<Boolean> callback) {
    final Set<IDataModel> modifiedModels = getModelsToSave(getRelevantModels(changeRespose.getChangeType()));
    for (final IDataModel model : modifiedModels) {
        model.addModificationStateListener(new ModificationStateListener(modifiedModels, model, callback));
    }
    saveDelegate.save();
}
Also used : IDataModel(org.jowidgets.cap.ui.api.model.IDataModel) IModificationStateListener(org.jowidgets.cap.ui.api.model.IModificationStateListener)

Aggregations

IDataModel (org.jowidgets.cap.ui.api.model.IDataModel)7 IBeanRelationNodeModel (org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel)3 IEnabledState (org.jowidgets.api.command.IEnabledState)1 QuestionResult (org.jowidgets.api.types.QuestionResult)1 DataModelChangeType (org.jowidgets.cap.ui.api.model.DataModelChangeType)1 IModificationStateListener (org.jowidgets.cap.ui.api.model.IModificationStateListener)1 IValidationResultBuilder (org.jowidgets.validation.IValidationResultBuilder)1