Comments (2)
Update on this, I got it working well enough by using an if statement at the start of my observe block, but I could still use some help if anyone has suggestions. Since input$conditional_input1,2and3 only exists if user answers 'Yes' to a previous input, the following works pretty well, but I'm sure there is a more elegant way to achieve this:
observe({
# Thought that req() would work but ended up working better with subsequent if statement
# req(input$conditional_input1)
if (!isTruthy(input$conditional_input1) && !isTruthy(input$conditional_input2) && !isTruthy(input$conditional_input3)) {
print('conditionally running')
lapply(c("conditional_input1", "conditional_input2", "conditional_input3", function(n) {
observe({
validateF7Input(
inputId = ns(n),
pattern = "^\\d*\\.?\\d+$", # regex for int or float
error = "Please enter a number"
)
})
}
)
}
})
Apologies that this example or the examples above aren't given in a demo shiny app.
from shinymobile.
Thx for your consideration. FYI for my use case I ended up going with your radio input combined with shinyjs show() and hide() and that seems to be working well so far. I decided the falsy check above and the observe() within observe() was too hard to reason about and the input warnings weren't working perfectly.
from shinymobile.
Related Issues (20)
- f7Page Issue HOT 2
- with shiny1.7.2, renderUI and shinyJS::show are not working HOT 3
- f7 functions not working anymore HOT 6
- uiOutput does not work in the f7Panel
- Adding a language parameter in f7SmartSelector HOT 1
- Modify f7Col width as it is possible with Rshiny::column(width=10)
- Popups can't be reopened multiple times HOT 2
- updateF7Select choices HOT 1
- js code not working HOT 8
- some error when use app_container function HOT 1
- Stylesheet not load... sometimes. Works on refresh page... sometimes. HOT 1
- General error on `f7Popup()` function HOT 1
- f7TabLayout problem HOT 5
- about Authentication HOT 2
- Tab labels not showing HOT 2
- How to run shinymobile in desktop as mobile app HOT 1
- Is this project still alive? HOT 2
- f7DatePicker is off by one day
- height parameter doesn't work on r7ExpandableCard HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shinymobile.