Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4339488
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:13:23+00:00 2026-05-21T11:13:23+00:00

I have problem with change of tab panel layout by click event on buton

  • 0

I have problem with change of tab panel layout by click event on buton located on that panel. The main idea is to have custom menu (new, open, del) on smal panel on every tab panel. When you click button, tab panel layout is change to form (for example). I don’t want use modal window or new window, just change the tab panel layout (content) to something else by button click.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:13:24+00:00Added an answer on May 21, 2026 at 11:13 am

    It, is wrong specified question – you should ask how to notify parent component.
    Bellow you have two examples show how to achive your goals. This first implementation does what Jens Janssons suggest on vaadin forum, you pass the ClickListener to the second panel as a constructor parameter. Note that to be able to remove the component from the outer panel, you need both a reference to the outer panel and to the inner panel. In this example Kim Lappanen stored the references in class variables. Note that ther is actually used a HorizontalLayout for what you called your “panel”, you can change it.

    public class TestcaseApplication extends Application implements ClickListener {
        private static final long serialVersionUID = 75232258896642392L;
    
        private final HorizontalLayout mainLayout = new HorizontalLayout();
        private final YourPanel panel = new YourPanel(this);
    
        @Override
        public void init() {
            setTheme("example");
            Window mainWindow = new Window("Playground Application");
            setMainWindow(mainWindow);
    
            mainWindow.setContent(mainLayout);
    
            mainLayout.addComponent(panel);
        }
    
        public void buttonClick(ClickEvent event) {
            mainLayout.removeComponent(panel);
        }
    
        public class YourPanel extends Panel {
    
            public YourPanel(ClickListener listener) {
                super();
                addComponent(new Button("Remove", listener));
            }
        }
    }
    

    Antoher example is to implement the ClickListener directly in the inner panel. In the buttonClick method, I just call getParent() (returns the out layout) and then removes itself from that layout.

    public class TestcaseApplication extends Application {
        private static final long serialVersionUID = 75232258896642392L;
    
        @Override
        public void init() {
            setTheme("example");
            Window mainWindow = new Window("Playground Application");
            setMainWindow(mainWindow);
    
            HorizontalLayout mainLayout = new HorizontalLayout();
            mainWindow.setContent(mainLayout);
    
            mainLayout.addComponent(new YourPanel());
        }
    
        public class YourPanel extends Panel implements ClickListener {
    
            public YourPanel() {
                super();
                addComponent(new Button("Remove", this));
    
            }
    
            public void buttonClick(ClickEvent event) {
                ((ComponentContainer) getParent()).removeComponent(this);
            }
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem to dismiss my progbar and to change to view that
I have this problem in my SlashDot Menu. I want to change the picture
I have an Ext Js panel that I am adding to my main TabPanel.
Hey! Have a problem that is driving me crazy! My Main Window will not
I have problem with c# script who change user AD password, when try change
I have problem with dynamically created image (JavaScript). I want to change the innerHTML
I implemented the table sorter yesterday and i have a problem trying to change
I have a problem, I need to change body of method when this class
I have a problem with jQuery, I want to change a DIV (not the
I have a slight problem... we made a change to our url structure the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.