Package org.apache.isis.core.progmodel.facets.object.validate

Examples of org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectFacet


                @Override
                public void validate(final Form<?> form) {
                    final EntityModel entityModel = (EntityModel) getModel();
                    final ObjectAdapter adapter = entityModel.getObject();
                    final ValidateObjectFacet facet = adapter.getSpecification().getFacet(ValidateObjectFacet.class);
                    if (facet == null) {
                        return;
                    }
                    final String invalidReasonIfAny = facet.invalidReason(adapter);
                    if (invalidReasonIfAny != null) {
                        Session.get().getFeedbackMessages().add(new FeedbackMessage(form, invalidReasonIfAny, FeedbackMessage.ERROR));
                    }
                }
            });
View Full Code Here


                @Override
                public void validate(final Form<?> form) {
                    final EntityModel entityModel = (EntityModel) getModel();
                    final ObjectAdapter adapter = entityModel.getObject();
                    final ValidateObjectFacet facet = adapter.getSpecification().getFacet(ValidateObjectFacet.class);
                    if (facet == null) {
                        return;
                    }
                    final String invalidReasonIfAny = facet.invalidReason(adapter);
                    if (invalidReasonIfAny != null) {
                        Session.get().getFeedbackMessages()
                            .add(new FeedbackMessage(form, invalidReasonIfAny, FeedbackMessage.ERROR));
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectFacet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.