Vaadin 8: Create forms from Java beans - forms

I am looking for a library similar to MetaWidget which can derive an application form from a bean and vice versa for Vaadin 8. MetaWidget is on the state of Vaadin 6 and a little complicated to use.
If there isn't any library then I consider to create one myself but I don't wanted to recreate the wheel.

As noted in the comments, Vaadin 8 has built-in data binding supported with the Binder class. Especially, the bindInstanceFields maybe of interest for you to simplify binding bean properties to field components. Layouting is simplified by FormLayout.
However, I am not aware of an add-on or library that automatically picks the right field components and lays them out.
References:
Blog: Vaadin 8 Binder, Section "Declarative Binding"
Documentation: Forms

This Vaadin add-on may help. It generates CRUD UI from entity beans:
https://vaadin.com/directory/component/crud-ui-add-on/

Related

DisplayWecpofUI() missing

I tried the example in the CapableObjects document "Doing MVC with CapableObjects – a white paper in 4 parts" (http://www.new.capableobjects.com/xdownloads/Doing%20MVC%20with%20CapableObjects.pdf).
Most of it worked as described, but when I came to part 3 I could not modify the file Edit.cshtml. "#Html.DisplayWecpofUI()" causes an error.
EDIT: I searched for „DisplayWecpofUI“ in the Object Explorer... it doesn’t exist...
What am I missing here?
Wecpof enclosed the whole application including the main menu. This has subsequently been redesigned and is now part of the MDriven Turnkey product offering.
With MDriven Turnkey you provide model at the minimum. The Viewmodels in the model may be tagged as MVC or angular. You can inject your own model based code into turnkey with codedress, and styles and fashion with css and view overrides.

Errai 4.0.0.Beta1 and UiBinder

errai-uibinder is no more available for errai 4.0 (4.0.0.Beta1) but using uibinder without the specific treatment seems to be the cause of some runtime problems at startup in my application.
Has anyone successfully used UiBinder views with Errai 4.0 ?
Thanks,
S.
I think, Errai 4.0 will no longer support UiBinder. That's because generators will not be part of GWT 3.0. And because as long as no one will rewrite the Uibinder generators and replace them with APT, it will not work.
Take a look at the blog:
http://errai-blog.blogspot.de/2016/04/errai-400beta1-released.html
Errai offers an alternative way to create UIs.

Vaadin FormLayOut commit issue

In the newest version of Vaadin , we cannot use "Form" component(Deprecated) . So we have to use "FormLayout" Component .
What is the Equivalent for form.commit in "FormLayout"
How can we do the field validation in "FormLayOut"
Can we use the deprecated "Form" Component instead of "FormLayOut"
In vaadin 7 the Form is basically divided in to FormLayout and FieldGroup. The FormLayout is only used to specify the layout of the components, but you could use any other layout instead of it. Binding vaadin fields to object fields is done with FieldGroup.
https://vaadin.com/book/-/page/datamodel.itembinding.html
Equivalent of Form.commit() is FieldGroup.commit()
You add the validators to the fields and you can catch the exception when calling commit.
It is possible, but it will be harder to find support for problems related to it and I guess the new functionality and add-ons are mostly developed for non-deprecated features. Also as with all deprecated functionality, it might be removed in the future, so you might not be able to switch to newer vaadin version anymore if it is.

Tutorial on setting up GWT-Validation Framework for a simple app?

I'm looking to setup the GWT-Validation Framework (client side for now) in our application, but I'm not clear from the docs what pieces I need and what goes where?
We are using GWT 2.1 and MVP. I have the inherits entry for Validation in the gwt.xml, but what goes actually goes into the View, Activity, etc... I'm not aware of any tutorials available.
Any help would be appreciated!
Aftermath:
At the time when I was trying to use it, GWT 2.1 wasn't compatible with the GWT-Validation framework. After doing more reading I found this out. I don't know if that is still the case.
I assume you are referring to the validation framework in GWT and not the gwt-validation library? If that's the case, here is a page that describes how you can do bean validation: http://code.google.com/p/google-web-toolkit/wiki/BeanValidation. If you are actually referring to the gwt-validation library, here is a page that describes how to use it:
http://code.google.com/p/gwt-validation/wiki/ConceptOfOperations
Here is a link that gives some information about the GWT Validation Framework, GWT-Validator and the authors solution, the GWT-Validation library. It is a good synopsis of the issues and why he wrote the new library with some code snippets.
The GWT Validation Library.

Dynamically creating GWT screens using Metadata?

I have an AWT applet application that needs to be ported over to GWT. The applet screens are described in meta data and the applet renders each screen dynamically using reflection.
We'd like the same thing in GWT/ExtGWT.
I've built a working version of this ExtJS whereby the metadata is turned into ExtJS Screen configs in the form of JSON. The drawback with this approach is the "wiring" of controls to data needs to be written in Javascript.
GWT is preferred since it'd be all Java code, no JS. Upon digging in it's possible to render the screens using GWT off the metadata using GWT.create().
The problem I'm having is the wiring to hook a dynamically created button for example to an event handler requires reflection which is not supported in GWT.
Is this conclusion correct? and if so, are there any other ways to achieve this type of dynamic UI using ExtGWT?
For extGWT where we don't have declarative UI's the easiest solution might be to just add a mapping/config your handlers in java which refer to instantiated classes. of the handlers, i.e.:
Map<String, ActionListener> mapping = new HashMap<String, ActionListener>();
mapping.put("HandleClicked", new HandleClickedActionListener());
then you can try to find an implementing class for your meta data.
For pure GWT 2 you can take a look at http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideUiBinder.html#Simple_binding on how it's done there. it might be possible to create a similiar solution which annotated methods for you own extgwt solution like the one in gwt.