title: Fetching selection values from a dynamically generated SWT tables
body: <p>In my RCP app, I have a tab folder widget. Each of the tab items in the tab folder widget holds a single table. The tab items (represent name of a specific hall) are dynamic and whenever a tab item is created dynamically, a table is created to be displayed within that tab item. The tab items are being dynamically created along with the table (and the table's content too) for each item in the tab folder. </p>
  
  <p>Now when I try to retrieve the user selected values in the table in the first (or any other tab except the last one), I'm not able to get the values. I am able to retrieve and manipulate
  the table in the last tab item only. It seems like the preceding tables in the preceding tab items are replaced/overlapped by the new tables that are created dynamically later on. How do I solve this?</p>
  
  <p>For Instance,  </p>
  
  <pre><code>//createPartControl method
  public void createPartControl(Composite parent) {
      .....
      .....    
  
      createTabFolder();
  }
  
  
  // createTabFolder() method
  private void createTabFolder() {
  
  tabFolder = new CTabFolder(comMainContainer, SWT.BORDER);
  tabFolder.setBounds(204, 21, 769, 495);
      tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(
              SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
  
      // display the tabitems in the tabfolder dynamically
      try {
          selectedDate = sdf.format(dateChooser.getSelectedDate());
          rs = objHallBookingController.getHallList();
  
          while (rs.next()) {
  
              displayCtabItems(rs.getString("hall_name"),
                      rs.getInt("hall_id"));
          }
      } catch (SQLException e) {
          e.printStackTrace();
      }
  }
  
  
  // displayCtabItems method
  private void displayCtabItems(String hallName, int hallId) {
  
              tabItem = new CTabItem(tabFolder, SWT.NONE);
      tabItem.setText(hallName);
  
      comTabItem = new Composite(tabFolder, SWT.NONE);
      tabItem.setControl(comTabItem);
  
  
      tblHallBooking = new Table(comTabItem, SWT.BORDER | SWT.FULL_SELECTION);
      tblHallBooking.setHeaderVisible(true);
      tblHallBooking.setLinesVisible(true);
  
      tblclmnTime = new TableColumn(tblHallBooking[hallId], SWT.NONE);
      tblclmnTime.setWidth(88);
      tblclmnTime.setText("Time");
  
      tblclmnTitle = new TableColumn(tblHallBooking[hallId], SWT.NONE);
      tblclmnTitle.setWidth(306);
      tblclmnTitle.setText("Title");
  
              // display contents in the table; working fine
      displayHallOpeningTime(Integer.parseInt(txtHallId.getText()));
        }
  </code></pre>
  
  <p>This code generates and displays the tab items and the tables. But I can't manipulate the contents in the tables in the tab items other than the last one.</p>