Can I access a list of all input widgets within a module (let us name it myModule
) and check if their state is isTruthy()
.
I found a way that works when I know (or can deduce) the exact names of the widgets (see 1).
All_Inputs <- vapply(paste0('axis',1:3),
function(x) { isTruthy(input[[x]]) },
logical(1))
Of course, I also could do it with a long list of if (isTruthy(input$a) && isTruthy(input$b) && ...
. But both solutions are not satsifactory to me, mostly because of drawbacks regarding readability and maintainability.
I know that the input
class has them all listed under names that start with myModule-[AnyName]
. But I do not know how to use that information to access them using a loop or even better an apply
function.