I have created 3 tabs in my blackberry application.The first tab allows the user to select a particular date range and search for entries.The search button is on first tab.The results are fetched from a sqlite database and displayed on grid view of third tab. This is the main code i have used for creating tabs:
// setup the tab model with 3 tabs
PaneManagerModel model = new PaneManagerModel();
model.enableLooping( true );
// setup the first tab
VerticalFieldManager vfm = new VerticalFieldManager(
Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH |
Manager.NO_VERTICAL_SCROLL | Manager.NO_HORIZONTAL_SCROLL );
LabelField lbl = new LabelField( "Content for tab 1", Field.FOCUSABLE );
vfm.add( lbl );
MyLabelField myLbl = new MyLabelField( "Tab 1" );
NullField nullFld = new NullField( Field.FOCUSABLE );
HorizontalFieldManager hfm = new HorizontalFieldManager();
hfm.add( nullFld );
hfm.add( myLbl );
Pane pane = new Pane( hfm, vfm );
model.addPane( pane );
// setup the second tab
vfm = new VerticalFieldManager(
Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH |
Manager.NO_VERTICAL_SCROLL | Manager.NO_HORIZONTAL_SCROLL );
lbl = new LabelField( "Content for tab 2", Field.FOCUSABLE );
vfm.add( lbl );
myLbl = new MyLabelField( "Tab 2" );
nullFld = new NullField( Field.FOCUSABLE );
hfm = new HorizontalFieldManager();
hfm.add( nullFld );
hfm.add( myLbl );
pane = new Pane( hfm, vfm );
model.addPane( pane );
//Setup the third tab
vfm = new VerticalFieldManager(
Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH |
Manager.NO_VERTICAL_SCROLL | Manager.NO_HORIZONTAL_SCROLL );
lbl = new LabelField( "Content for tab 3", Field.FOCUSABLE );
vfm.add( lbl );
myLbl = new MyLabelField( "Tab 3" );
nullFld = new NullField( Field.FOCUSABLE );
hfm = new HorizontalFieldManager();
hfm.add( nullFld );
hfm.add( myLbl );
pane = new Pane( hfm, vfm );
model.addPane( pane );
At present the results are properly getting displayed in third tab.But they are not on button click of fist tab.
I have included my SELECT statement in the third tab content.Instead i want to display the third tab results only after i click on search from the first tab.Till then i want my third tab to be disabled or rather inactive.
Anyone having any idea on this please share.Thanks.