ConditionalPanel does not support variables with a dot in the name, any work around?

It will work

checkboxInput("test", "test", TRUE), conditionalPanel( condition="input.test", h2("test test") ), 

But it is not

  checkboxInput("tes.t", "tes.t", TRUE), conditionalPanel( condition="input.tes.t", h2("tes.t tes.t") ), 

Where does the document indicate that the dotted name is not supported? Is there any work, so I don’t need to change variable names?

+6
source share
1 answer

In conditionalPanel condition is a Javascript expression. You rely on Javascript notation when you enter "input.test".

You do not need to change variable names. There is an easy workaround, use the square notation instead: input["tes.t"]

  checkboxInput("tes.t", label="tes.t", TRUE), conditionalPanel( condition='input["tes.t"]', h2("tes.t tes.t") 

will work.

+7
source

Source: https://habr.com/ru/post/952096/


All Articles