FieldGroup is a very useful container in RAD but it has very limited options to be responsive. Is there any possibility we can make it responsive, something like this Vaadin Add-on Directory
somebody has a sample cuba that include this responsive addon ?
I have used this way in one of the UI.
-
add the dependency in web module (go to project propertise >> advanced)
compile('com.jarektoro:responsive-layout:1.3.4')
-
call the following procedure at init:
private void setResponsiveLayout(){
ResponsiveLayout responsiveLayout = new ResponsiveLayout();
responsiveLayout.setSizeFull();
ResponsiveRow row = responsiveLayout.addRow();com.vaadin.ui.Component vaadinImpl1 = fieldGroup1.unwrapComposition(com.vaadin.ui.Component.class);
com.vaadin.ui.Component vaadinImpl2 = fieldGroup2.unwrapComposition(com.vaadin.ui.Component.class);
com.vaadin.ui.Component vaadinImpl3 = fieldGroup4.unwrapComposition(com.vaadin.ui.Component.class);row.addColumn().withDisplayRules(12,6,4,4).withComponent(vaadinImpl1);
row.addColumn().withDisplayRules(12,6,4,4).withComponent(vaadinImpl2);
row.addColumn().withDisplayRules(12,6,4,4).withComponent(vaadinImpl3);Layout layout = targetBox.unwrap(Layout.class);
layout.addComponent(responsiveLayout);
}
I don’t think FieldGroup is responsive yet! but you may use CssLayout and use more than one field Group when your screen contains a lot of components.
what is targetBox ? missing something, I receive a compiler error.