Added tab press handling to switch the data to display.