Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put several ids in cleave() #1

Closed
etiennebacher opened this issue Jul 20, 2020 · 2 comments
Closed

Put several ids in cleave() #1

etiennebacher opened this issue Jul 20, 2020 · 2 comments

Comments

@etiennebacher
Copy link

@etiennebacher etiennebacher commented Jul 20, 2020

Here's an example:

library(shiny)
library(sever)

ui <- fluidPage(
  use_sever(),
  tableOutput("table"),
  plotOutput("plot"),
  uiOutput("thing")
)

server <- function(input, output){
  cleave("hey", ids = "table")
  
  output$table <- renderTable({
    error
  })
  
  output$thing <- renderUI({
    p(error)
  })
  
  output$plot <- renderPlot({
    plot(error)
  })
}

shinyApp(ui, server)

What if I want to display the same message for the table and the plot but not for the uiOutput? I tried to use c() and list() in the argument ids of cleave() but no success.

Is there a way to put a list of ids in cleave()?

JohnCoene added a commit that referenced this issue Jul 20, 2020
@JohnCoene
Copy link
Owner

@JohnCoene JohnCoene commented Jul 20, 2020

Hi Etienne,

Passing multiple ids to cleave was always meant to work hence the argument is named ids (plural): I'm afraid you just stumbled upon a bug. I just pushed a fix. Would you mind reinstalling from Github and let me know if it works for you?

library(shiny)
devtools::load_all()

ui <- fluidPage(
  use_sever(),
  tableOutput("table"),
  plotOutput("plot"),
  uiOutput("thing")
)

server <- function(input, output){
  cleave("hey", ids = c("table", "plot", "thing"))
  
  output$table <- renderTable({
    error
  })
  
  output$thing <- renderUI({
    p(error)
  })
  
  output$plot <- renderPlot({
    plot(error)
  })
}

shinyApp(ui, server)

@etiennebacher
Copy link
Author

@etiennebacher etiennebacher commented Jul 20, 2020

Perfect, it works now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants