How to have pagination in vaadin (the data isn't table)

I am trying to create a tab-pane and each tab containing many pages. However, I didn’t see any example or code for pagination in vaadin. The examples that i have seen are applicable only to tables. Also I tried creating my own pagination but the I need to trigger a mouse Click programmaticaly which also I couldn’t do.

for(int i=0;i<v.size();i++) {
Button b = v.get(i);
b.addClickListener(e->{
if(b.getCaption()==“>”) {
if(page%5==0) {

                    final int mn = Math.min(v.size()-2,page+5);
                    grid.removeAllComponents();
                    
                    grid.addComponent(pre, 2, 3);
                    int j = 1;
                    for(j=1;j<mn-page+1;j++) {
                        grid.addComponent(v.get(page + j-1),3+j,3);
                    }
                    grid.addComponent(ne, j+4, 3);
                    
                    
                }
                bt = v.get(page);
                bt.click();
            
                page++;
            }
            else if(b.getCaption()=="<") {
                if(page%5==1) {
                    grid.removeAllComponents();                        
                    grid.addComponent(pre, 2, 3);
                    int j = 1;
                    for(j=5;j>0;j--) {
                        grid.addComponent(v.get(page - j-1),9-j,3);
                    }
                    grid.addComponent(ne, 10, 3);
                }
                page--;
            }
            else{
                page=Integer.parseInt(b.getCaption());
            }
              
            
            
            if(page==v.size()-2) ne.setEnabled(false);
            else ne.setEnabled(true);
            
            if(page==1) pre.setEnabled(false);
            else pre.setEnabled(true);
          });
        
    
    }

One example of pagination with Grid can be found in
https://vaadin.com/directory/component/gridextensionpack-add-on
, which includes paged data source (DataProvider for Vaadin8 and Container for Vaadin 7) plus demo.

I want to have pagination on gridlayout so basically each page containing diiferent gridlayout. So will this add-on do the job ?

Good question, sorry it is not helping with GridLayout. With GridLayout you need to create your own logic.

That’s what I was trying to do and for that I need to trigger mouse click programmaticaly. Is there any method for it ? button.click() isn’t doing the job. Thanks