use of org.linkki.samples.messages.pmo.RegistrationValidationService in project linkki by linkki-framework.
the class MessageUI method init.
@Override
protected void init(VaadinRequest request) {
Page.getCurrent().setTitle("linkki Samples :: Validation Messages");
VaadinSession.getCurrent().setConverterFactory(new LinkkiConverterFactory());
MessagesPanel messagesPanel = new MessagesPanel();
messagesPanel.setVisible(false);
User user = new User();
RegistrationSectionPmo registrationPmo = new RegistrationSectionPmo(user, u -> handleRegistration(messagesPanel, u));
// tag::validation-service[]
validationService = new RegistrationValidationService(registrationPmo);
bindingManager = new RegistrationBindingManager(validationService, ml -> messagesPanel.updateMessages(ml));
// end::validation-service[]
DefaultPmoBasedSectionFactory sectionFactory = new DefaultPmoBasedSectionFactory();
AbstractSection section = sectionFactory.createSection(registrationPmo, bindingManager.getExistingContextOrStartNewOne(getClass()));
setContent(new VerticalLayout(messagesPanel, section));
}
Aggregations