Send selectInput value when input changed (without needing submit button) Shiny R - r

I am trying to make it so that when I change my selectInput value it reactive value is passed automatically without needing to press a submit button. Is this possible?
selectInput("variable1", "Choose ID:", vec)
The above requires a submit button to be clicked before the value is passed.

Related

Refreshing R Shiny Result Panel without closing app

I am updating one of my Shiny apps and have implemented a "Refresh" button that is supposed to remove output from the Result Panel (i.e., where plots/tables are printed to) in Shiny:
actionBttn(inputId = "refresh",
label = "Refresh",
color = "success",
style = "jelly",
size ="sm",
block = FALSE
)
I have seen this previous SO Post: refresh the main panel screen in shiny using the action button, which is not exactly what I'm after, since running it simply closes the app itself (which can be accomplished directly in RStudio anyway). I swapped an observe() for an observeEvent(). Trying it both ways gave the same behaviour.
In my case, the app window should remain open, but upon pressing the "Refresh" button, should result in a blank Result Panel.

How to determine tab order in Shiny

What determines the user tabbing order in shiny? (Where the cursor goes in the input fields on each tab press).
I've looked for documentation on this but can't find anything.

How to get submitButton to not take effect until after the initial loading of the R Shiny App?

I have a Shiny app that has widgets which control the out of a map.
There are several inputs.
I don't want the map to reload until the user has edited all of the inputs they want to edit.
Hence I have this line of code:
submitButton("Update Map", icon("refresh"))
in my UI, which only reloads the map if the user press on the button.
But now it won't load the initial map upon the launching of the app.
I want that behavior.
What do I need to change?

R Shiny How make a help box appear with an action button

I have created an action button as follows in my ui
div(style="display:inline-block",actionButton("action", label = "Help"))
I want this button to create a help box which the user can close which contains text on how to use this app. How do i do this?
Also, how do I customise this button? such as font, colour, alignment...
Thanks
Clicking the action button increments a value, initially 0. You could use renderUI in your server.R file to define a widget that is empty when input$action is even, and helpText when it is odd. That way, the same action button would both open and close the help.
output$HelpBox = renderUI({
if (input$action %% 2){
helpText("Here is some help for you")
} else {
return()
}
})
In ui.R, use the uiOutput function to display the widget. Remember that it will display nothing until the action button is clicked.
uiOutput("HelpBox")

R: submitButton and conditionalPanel

I've got a UI that is entirely build with conditional panels. But the problem I am having now is that I need a submit button. When introducing the submit button, it will render all the conditional UI to not show up conditionally unless I press the submit button.
My question is if there is a way so that the conditional display of various UI sliders, input, etc be not dependent on the submit button?
Thanks,
I had this problem when I was using the submit button to crunch data intensive code that was dependent on the widgets I programmed on the reactive interface. As soon as I added a submit button, all reactive widgets became static until i pressed the submit button (which was a pain because I had a reactive plot on the main panel). Thanks to the wonderful Mr. Cheng, I found out that you cannot (yet) make individual widgets dependent on a submit button. It is an all or nothing kind of deal. Therefore it may better to use an 'actionButton', sandwiched between the 'observe' and 'isolate' functions. It may look something like this..
observe({
if (input$action_button == 0) # tells action button to do nothing when not clicked ..
return()
isolate({ # this isolates the code you want to execute when clicking the action button..
###some function or conditional panel###
})})
Hopefully this works for you. It did for me :)

Resources