How to send the output of tab1 to the input of tab2 and activate tab2?
For example, I have following mini app :import gradio as gr

def processing1(text):
    return "result1", "result2"
    
def send():
    pass

def processing2(text):
    return "result3"

tab1 = gr.Blocks()
with tab1:
    with gr.Row():
        with gr.Column():
            input_text = gr.TextArea(label="Input Text", placeholder="Paste your text here")
            submit_btn = gr.Button("submit")
        with gr.Column():
            output_text1 = gr.TextArea(label="Output Text")
            output_text2 = gr.TextArea(label="Output Text2")
            send_btn = gr.Button("send to tab2")
    submit_btn.click(processing1, inputs=[input_text], outputs=[output_text1, output_text2])
    send_btn.click(send)

tab2 = gr.Blocks()
with tab2:
    with gr.Row():
        with gr.Column():
            input_text2 = gr.TextArea(label="Input Text", placeholder="Paste your text here")
            checkbox1 = gr.Checkbox(label="checkbox1")
            checkbox2 = gr.Checkbox(label="checkbox2")
            submit_btn2 = gr.Button("submit")
        with gr.Column():
            output_text3 = gr.TextArea(label="Output Text")

    submit_btn2.click(processing2, inputs=input_text2, outputs=output_text3)

demo = gr.TabbedInterface([tab1, tab2], tab_names=["tab1", "tab2"])
demo.launch()I want send the output of tab1 (here is the “result2”) to the input of tab2(here is theinput_text2) and active the tab2 as current tab, how to achieve this ?
2023-08-10T13:44:24Z
I guess this could use javascript, but I am not familiar with javascript, so I don’n know how to do
2023-08-15T16:13:39Z
Hi@wwdokit is possible to update the tab programmatically, please see:Be able to set the active `Tab` programmatically · Issue #2412 · gradio-app/gradio · GitHub
2023-09-16T16:43:03Z
I try the code inside the link, it really activate the tab programmatically, thank you ! But I still have another question, that is how to send image and text from one tab to another tab programmatically.