I have a tabbed panel that displays a person's information. Outside that
panel are several links, which can be clicked to change the person whose
information is being displayed in the tabbed panel.

 

My problem is that it only works the first time the user clicks a link.
Any subsequent clicks do nothing-the panel continues to show the
original person's information. Here's my code. Any suggestions what I'm
doing wrong?

 

IndividualViewArea viewArea = new WebMarkupContainer("viewArea") {

  List tabs = new ArrayList();

  tabs.add(new AbstractTab(new Model("Information")) {

    @Override

    public Panel getPanel(String panelId) {

      return new Panel(panelId);

    }

  });

                  

  AjaxTabbedPanel tabbedPanel = new AjaxTabbedPanel("individualTabs",
tabs);

  add(tabbedPanel);

};

 

AjaxFallbackLink personInfoLink1 = new
AjaxFallbackLink("personInfoLink") {

  @Override

  public void onClick(AjaxRequestTarget target) {

    viewArea.tabs.set(0, new AbstractTab(new Model("Information")) {

      @Override

      public Panel getPanel(String panelId) {

        return new IndividualInformationPanel(panelId,
getPerson("some_id"););

      }

    });

    target.addComponent(viewArea);  

  }

};

 

AjaxFallbackLink personInfoLink2... // Just like personInfoLink1 above,
but with a different person

 

AjaxFallbackLink personInfoLink3... // etc.

 

Reply via email to