Coder Social home page Coder Social logo

Comments (6)

pvictor avatar pvictor commented on September 17, 2024

Hello,
Are your inputs in a server-side renderUi?

Victor

from shinywidgets.

 avatar commented on September 17, 2024

yes they are indeed. Just found out that using a conditional panel causes the same problem, so I realize its a fundamental flaw in my approach. Maybe better delete my post here since it's out of place here. If ok, I would send you an email in case you have a possible answer how to work around my issue?

from shinywidgets.

pvictor avatar pvictor commented on September 17, 2024

Yes that's the same :)
You need outputOptions like below (comment/uncomment to see difference) :

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  tags$h1("Dropdown & inputs"),
  dropdownButton(
    icon = icon("sliders"), status = "info",
    uiOutput(outputId = "params")
  ),
  verbatimTextOutput(outputId = "res")
)

server <- function(input, output, session) {
  
  output$params <- renderUI({
    tagList(
      tags$b("Parameters:"),
      sliderInput(inputId = "slider", label = "Slider", min = 1, max = 100, value = 4),
      selectizeInput(inputId =  "selectize", label = "Selectize", choices = letters),
      radioButtons(inputId = "radio", label = "Radio", choices = month.abb[1:4]),
      checkboxGroupButtons(inputId = "checkbox", label = "Checkbox", choices = month.abb[1:4])
    )
  })
  
  # >>>>>>>> You need this line ! <<<<<<<<<
  outputOptions(x = output, name = "params", suspendWhenHidden = FALSE)
  
  output$res <- renderPrint({
    reactiveValuesToList(input)
  })
  
}

shinyApp(ui, server)

Victor

from shinywidgets.

 avatar commented on September 17, 2024

Oh very elegant! I have come across that line of code long ago I remember now, but forgot about it. Much appreaciate the tip! Good luck with the continuation of your work on ShinyWidgets, I'm sure there are many interesting new features to be imagined to add 👍

from shinywidgets.

pvictor avatar pvictor commented on September 17, 2024

You're welcome :) Many thanks for your encouragement !

Best,

Victor

from shinywidgets.

 avatar commented on September 17, 2024

Hey pvictor, I send an email to your address listed here a week ago with some suggestions fixes and follow up questions. Perhaps you missed it?

from shinywidgets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.