How to get a Custom Component selectable in Designer

Hello Forum,

when I use the designer I get a selection of Components (lables, layouts…) and own custom components from the same package (or primary package where the UI is located) on the right hand of the designer.

I have other packages with custom componentes, but these components are not selectable or shown in the designer (symbol of puzzle piece is missing).

Is there a solution?

Regards

Alex

Only the CustomComponents that is in the project you currently are using is shown in the Visual Designer. Is your other CustomComponents coming from other jars in the project?

Visual Designer will show any Vaadin addons in the project in the list as long as they have been packaged according to Vaadin Addon directions (have a propert MANIFEST). If you want to see your custom components from other jars you need to package them as Vaadin addons as well.

Hello John,

thanks for your answer.

The component is inside a package but not in the package where the UI class is located.

Is there a restriction?

Regards

Alex

Getting error as tabsheet can not resolved while compile time, please help sir

package com.example.dyanamictab;

import javax.servlet.annotation.WebServlet;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@SuppressWarnings(“serial”)
@Theme(“dyanamictab”)
public class DyanamictabUI extends UI {

@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = DyanamictabUI.class)
public static class Servlet extends VaadinServlet {
}

@Override
protected void init(VaadinRequest request) {

    final TabSheet tabsheet = new TabSheet();
    
    Button button = new Button("Add the tab");
    button.addClickListener(new Button.ClickListener() {
        final VerticalLayout layout = new VerticalLayout();
        public void buttonClick(ClickEvent event) {
            layout.addComponent(new Label("This is the tab content."));
            Tab tab = tabSheet.addTab(layout, "The new Tab", null);
                   
            
        }
    });

}

}

Hi,

I need to create dynamic tab. But i tried below code, it is showing error as tabsheet can not be reolsved while compile time itsef. please help me out on this.

package com.example.dyanamictab;

import javax.servlet.annotation.WebServlet;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@SuppressWarnings(“serial”)
@Theme(“dyanamictab”)
public class DyanamictabUI extends UI {

@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = DyanamictabUI.class)
public static class Servlet extends VaadinServlet {
}

@Override
protected void init(VaadinRequest request) {

    final TabSheet tabsheet = new TabSheet();
    
    Button button = new Button("Add the tab");
    button.addClickListener(new Button.ClickListener() {
        final VerticalLayout layout = new VerticalLayout();
        public void buttonClick(ClickEvent event) {
            layout.addComponent(new Label("This is the tab content."));
            Tab tab = tabSheet.addTab(layout, "The new Tab", null);
                   
            
        }
    });

}

}

Hello Sakthiplan,

you have posted your question in the wrong thread.

Please open a new and if possible, remove from here…

Regards

Alex

Hello Forum, hello John,

Unfortunately the question is still open.

Therefore:

The component is inside a package but not in the package where the UI class is located.

Is there a restriction?

Regards

Alex

Hello John,

thanks for your answer.

The component is inside a package but not in the package where the UI class is located.

Is there a restriction?

Regards

Alex