1

I'm working with an shiny app and i'd like to create an query with an action button that updates the url according to the user input (in this case, a textInput input$query_user).

For example, this is my ip: http://127.0.0.1:6858

And after the user fills the textInput, clicks an action button it would upload the url to http://127.0.0.1:6858/?lookfor=query_user

I've seen this post: R shiny: Add weblink to actionButton

but it doesn't work, because the example does not reads my input.

actionButton(inputId='query_button',
             label="Search", 
             icon = icon("th"), 
             onclick = paste("location.href='http://127.0.0.1:6858?lookfor=",
                             input$query_user, "'", sep="))
  )
)
divibisan
  • 11,659
  • 11
  • 40
  • 58
Lucca Ramalho
  • 573
  • 1
  • 6
  • 16
  • 1
    Take a look at: https://shiny.rstudio.com/reference/shiny/1.0.4/updateQueryString.html. Rather than "navigating" you can just update the querystring. – MrFlick Mar 13 '19 at 18:07
  • There's a typo in the code you posted: the `sep` argument is incomplete – divibisan Mar 13 '19 at 18:07
  • @MrFlick i've used that example you showed me, but how could i change this "For mode = "push", only three updates are currently allowed: the query string (format: ?param1=val1&param2=val2)" to my personal format (?lookfor=) thanks – Lucca Ramalho Mar 13 '19 at 19:18

0 Answers0