I need to reset the fileInput control whenever the user switches between two tabs inside a tabsetPanel.
I have looked up the existing questions on this topic but haven't been able to tailor it to my needs. how can I update a shiny fileInput object?
I dont have a clear button or a refresh button - the switch on tabs should do this.
Below is my ui.R
fluidPage(
fluidRow(column(width=10,
tabsetPanel(id="tabPanelOptions",
tabPanel(value="FixedwidthTab", "Fixed width",
br(),
fluidRow(column(width=12, fileInput('layoutfile', 'Upload Excel file to define layout', accept = '.xlsx')))
),
tabPanel(value="DelimitedTab", "Delimited",
br(),
fluidRow(column(width=5, textInput("separator", "Field separator:",","))),
fluidRow(
column(width=5, checkboxInput("quotes","Quoted texts?",FALSE)),
column(width=5, checkboxInput("header","Files contains header (column names)",FALSE))
),
fluidRow(column(width=10, textInput("expcolumns", "Expected variables in file","27"))),
fluidRow(column(width=10, fileInput('headerfile', '(Optional) Upload CSV file to define attribute names', accept = c('text/csv','text/comma-separated-values', 'text/tab-separated-values', 'text/plain','.csv','.txt')))),
br(),
fluidRow(
column(width=5,conditionalPanel(condition= "input.header == false",uiOutput("choose_columns"))),
column(width=5,conditionalPanel(condition= "input.header == false", uiOutput("rename_columns"))))
)
)
)
)
)
User can upload files while in the first tab called "FixedwidthTab" and then switch to the second tab called "DelimitedTab" - and vice versa. Both tabs have fileInput controls and I need them to reset on tab switching.