paged fields on a formLayout

We have a FormLayout, on which we are adding dozens of text fields or checkboxes. What I want to achieve is having 10 or 20 fields visible at a time, and use < and > buttons to page through the fields. I’m sure this must be easy to do. Appreciate any hints!



There’s probably a ton of different ways to accomplish this. If you want it to be paged (e.g. 20 items on each “page”), one option is to split the fields into one or more formlayouts and hide/unhide them based on whether < or > is clicked. This approach is very similar to how tabs work, sans the tabs of course.

If you want it to be more granular, and have one formlayoyt, you can hide/unhide individual formitems.

I use the latter method in my app. I use a RadioButtonGroup to alter the form based on user selection:

   private void paymentMethodChanged(PaymentMethod pm) {

      boolean credit = PaymentMethod.CREDITCARD.equals(pm);
      boolean cash = PaymentMethod.CASH.equals(pm);
      boolean check = PaymentMethod.CHECK.equals(pm);

      fiAmount.setVisible(credit || cash || check);


Thanks for the advice, worked like a charm!