闪亮 - 如何获得最后一个推动的Radiobutton的价值?
我有5个radiobuttons,其中包括“是”和“否”。 我希望只有在RadioButton上选择“否”时,才希望弹出式弹出仪。 我试图用if语句来解决它,但是逻辑不起作用,因为如果“ buttonabluf1”是否,然后将“ buttonabluf2”推到是的,modaldialog弹出了:
if(isTRUE(input$buttonAbluf1=="No" ||
input$buttonAbluf2 =="No" ||
input$buttonAbluf3 =="No" ||
input$buttonAbluf4 =="No" ||
input$buttonAbluf5 =="No"))
{
showModal(popup())
}
popup <- function(){
modalDialog(easyClose = F,
textAreaInput("com", "Bemerkung:", width = "750px", heigh = "200px"),
size = "l",
)
}
我如何定义逻辑,那就可以只有选择“否”,无论其他放射线to菜,它都会弹出吗? 我考虑过要获得最后一个按钮的值。如果此值不是该值,则可以显示Modaldialog。
I have 5 radiobuttons with the choices "yes" and "no".
I want a modalDialog to popup only if you select "no" on the radiobutton.
I tried to solve it with a if statement, but the logic doesn't work, because if "buttonAbluf1" is no and after that the "buttonAbluf2" is pushed to yes, the modalDialog pops up:
if(isTRUE(input$buttonAbluf1=="No" ||
input$buttonAbluf2 =="No" ||
input$buttonAbluf3 =="No" ||
input$buttonAbluf4 =="No" ||
input$buttonAbluf5 =="No"))
{
showModal(popup())
}
popup <- function(){
modalDialog(easyClose = F,
textAreaInput("com", "Bemerkung:", width = "750px", heigh = "200px"),
size = "l",
)
}
How could I define the logic, that it only pops up if you select "no", regardless the selection on the other radiobuttons?
I thought about getting the value of the last pushed button. If this value is no the modalDialog could be shown.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是观察者的目的:
由于您所有的按钮都应相同,因此您也可以将它们全部包裹在一个前面:
This is what observeEvent is for:
As all you buttons should behave the same, you can also wrap them all in one for-loop: