# Multiple tabs in one file

**URL:** <https://community.plotly.com/t/multiple-tabs-in-one-file/22841>\
**Category:** Dash Python\
**Created:** [April 28, 2019, 9:29pm UTC](https://community.plotly.com/t/multiple-tabs-in-one-file/22841 "2019-04-28T21:29:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tedsea](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@Tedsea](https://community.plotly.com/u/Tedsea)\
**Post date:** [April 28, 2019, 9:29pm UTC](https://community.plotly.com/t/multiple-tabs-in-one-file/22841/1 "2019-04-28T21:29:52Z")

</div>

Hello,  
I am trying to have a multiple tab set up with dash in the same file . Basically so that I dont re-run some calculations.  
What happens is that when I run my dash script at first It works perfectly. Once I go to the second tab and I try to go back to the first one, the data is not loading.  
The tab picker call back output is an input of the second layout but I cant manage to add it as an input for the first layout.  
I am thinking of a solution but I am not very familiar with dash:  
1- Is there a way a callback can be skipped if it doesnt find an input or output ID ? Hence when the layout 2 is not activated only the callbacks related to the layout 1 is activated?  
2- Can I explicitely ask for a callback to be fired when another callback A or B is fired depending on a certain condition?

I am basically having/  
layout1 = …  
layout2= …

MainLayout=…  
@app.callback… to choose the tab  
@app.callback… related to tab1  
@app.callback… related to tab2  
the inputs and outputs of each tab specific callback only exist in either tab1 or tab2

Basically I am not separating the callbacks in different files to use the same object intiated in tab1 callback…

Can someone help me with this one please?
