PDA

View Full Version : How to add Tabs dynamically



Suma
9 Jun 2009, 11:09 PM
Hi,
I have a Grid, Button and a PopUp window, On selecting any row from Grid Button will be enabled and on clicking that Button a PopUp window will get visible. In this window i want to display Tabs dynamically based on the number of records retrieved from Database. And also the name of Tab item is a value from the data retrieved from database.Kindly help me in solving this problem.

sven
10 Jun 2009, 3:34 AM
You can simple add this tabs to the tabpanel. The layout of the TabPanel will manage the displaying of the tabs.

Suma
10 Jun 2009, 4:00 AM
I want to know how to add this tabs to TabPanel because i doesn't know how many tabs to create as the data is coming from database.

sven
10 Jun 2009, 4:01 AM
tabpanel.add(tabItem)

Suma
10 Jun 2009, 4:15 AM
Number of tabItems depends on the number of records fetched from database.From database if i get 1 record i have to add 1 tabItem, if 2 records then 2 tabItems and so on.........

sven
10 Jun 2009, 4:21 AM
for(int i=0;i<recordcount;i++){
TabItem item = new TabItem();
tabpanel.add(tabItem);
}