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.
Related
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/
We have been using GWT for around 4 years now. One of the most often discussed features missing in native GWT is data binding. Reading across AngularJs another Google offering, i came across http://devgirl.org/2013/03/21/fun-with-angularjs/ . I do not wish to use GXT or any other third party tools. I also wish to avoid generator related solution.
Is there any way this will ever be implementable in pure native GWT?
Is there any specific reason why GWT cannot provide this out of the BOX?
Have you tried GWT Pectin?
I have used it successfully in a larger project some time ago.
I suggest you try HexaBinding, which is non invasive and only focused on data binding. Here is the link : https://github.com/ltearno/hexa.tools/blob/master/hexa.binding/README.md
It works with pure Java, GWT and will soon work also with Android and JavaFX. It may even work with J2Objc but not sure yet...
I read the post you mention on devgirl about AngularJS. In that post the "2 way data binding" refers to the property of the code to reflect automatically on the view the changes that occurs to the data that the view is currently displaying.
This is achieved in GWT since version 2.1 with the Cell Widgets
In the first paragraph of the Cell Widgets documentation I linked above it is clearly stated that:
A cell widget can accept data from any type of data source. The data
model handles asynchronous updates as well as push updates. When you
change the data, the view is automatically updated.
If you want to do in GWT something as basic as the example in the devGirl post you need to write a onKeyup handler (in AngularJS you should write a Scope to this purpose) that would copy what you entered to the linked label. Something like this:
...
final TextBox nameField = new TextBox();
final Label enteredName = new Label("");
...
public void onKeyUp(KeyUpEvent event) {
enteredName.setText(nameField.getText());
}
...
in a smartgwt DynamicForm, how can I add a validator to an existing set of validators within a FormItem ?
The only method I found in the official api is "setValidator(Validator)", but this seems to overwrite all the existing ones.
I would prefer a java approach to this (i.e. using smartgwt api), but in the end, if no solutions are available, at least a "js" native method would do the job.
thanks
Most likely, you don't want to by trying to dynamically add a validator at all.
First, read the Data Binding section of the QuickStart Guide, which shows how you can add screen-specific validators to a form while still inheriting validators declared in the DataSource.
Second, if you're trying to dynamically change the list of validators because some data that validation depends on is changing, take a look at the CustomValidator instead.
If you have some reason to add a validator dynamically that isn't handled by these approaches, try explaining it in detail.
Finally, you can continue with your current approach (not recommended) if you just refactor such that you can provide all the appropriate validators to the FormItems in a single setValidators() call.
I've looked at all of the libraries listed in: Best GWT widget library?
Honestly, gwt-ext looks the best, but it's no longer being maintained (and the old project lead for some reason recommends SmartGWT instead.) I don't like the approach of SmartGWT, both because it wraps Javascript, and because it wants me to wrap my backend classes in its various data components (I don't want to have to translate my model objects just to use its widgets). Vaadin looks nice, but again doesn't seem to want to let me just use it as a client widget library; I have to use its server components. GXT looks fine, but the open source license doesn't apply to my organization.
Everything else on the list hasn't been updated in a long time.
Is there no GWT widget library that just focuses on providing better widgets, and doesn't want to force you to use its architecture to develop your UI?
GWT Mosaic is another widget library using the more lenient Apache license
I want to add a 'Plone portlet' widget in Faceted criteria config screen. In particular, here I need a static portlet to add URL links. How do I fill the 'Portlet macro' field for a static portlet? Helper message is 'Path to portlet macro', and I already try values like 'here/portlet_static/macros/portlet' and 'here/portlet_recent/macros/portlet', all failed.
Plone 4.0.2 + eea.facetednavigation 4.0rc1
I don't know anything about eea.facetednavigation but it sounds to me like you have a bad mix of portlet technologies.
The /macros/portlet slot was only available in classic portlets based on simple templates as used in Plone 2.5. Since Plone 3 we have a completely different portlet machinery which no longer has any TAL macros in them.
As far as I know the EEA site is still using Plone 2.5 - so I wouldn't be surprised if many of their add-ons aren't compatible with later versions of Plone.