{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shiny/issues/167","labels_url":"https://api.github.com/repos/rstudio/shiny/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shiny/issues/167/comments","events_url":"https://api.github.com/repos/rstudio/shiny/issues/167/events","html_url":"https://github.com/rstudio/shiny/issues/167","id":15288896,"number":167,"title":"reset value of actionButton?","user":{"login":"stratosfmos","id":4026930,"avatar_url":"https://avatars.githubusercontent.com/u/4026930?v=3","gravatar_id":"","url":"https://api.github.com/users/stratosfmos","html_url":"https://github.com/stratosfmos","followers_url":"https://api.github.com/users/stratosfmos/followers","following_url":"https://api.github.com/users/stratosfmos/following{/other_user}","gists_url":"https://api.github.com/users/stratosfmos/gists{/gist_id}","starred_url":"https://api.github.com/users/stratosfmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratosfmos/subscriptions","organizations_url":"https://api.github.com/users/stratosfmos/orgs","repos_url":"https://api.github.com/users/stratosfmos/repos","events_url":"https://api.github.com/users/stratosfmos/events{/privacy}","received_events_url":"https://api.github.com/users/stratosfmos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":48,"created_at":"2013-06-07T19:55:25Z","updated_at":"2015-10-30T17:23:56Z","closed_at":"2013-06-12T17:19:01Z","body":"can an actionbutton be reseted to 0 inside server.R?\r\nlet's say i have actionButton(\"b1\",\"button1\"). what could be the code for reseting the action button to 0?\r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/shiny/issues/comments/152593281","html_url":"https://github.com/rstudio/shiny/issues/167#issuecomment-152593281","issue_url":"https://api.github.com/repos/rstudio/shiny/issues/167","id":152593281,"user":{"login":"mikebirdgeneau","id":4763142,"avatar_url":"https://avatars.githubusercontent.com/u/4763142?v=3","gravatar_id":"","url":"https://api.github.com/users/mikebirdgeneau","html_url":"https://github.com/mikebirdgeneau","followers_url":"https://api.github.com/users/mikebirdgeneau/followers","following_url":"https://api.github.com/users/mikebirdgeneau/following{/other_user}","gists_url":"https://api.github.com/users/mikebirdgeneau/gists{/gist_id}","starred_url":"https://api.github.com/users/mikebirdgeneau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikebirdgeneau/subscriptions","organizations_url":"https://api.github.com/users/mikebirdgeneau/orgs","repos_url":"https://api.github.com/users/mikebirdgeneau/repos","events_url":"https://api.github.com/users/mikebirdgeneau/events{/privacy}","received_events_url":"https://api.github.com/users/mikebirdgeneau/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T17:23:56Z","updated_at":"2015-10-30T17:23:56Z","body":"I stumbled upon this issue, while looking for a way to write a single handler that can respond to a large number of individual action buttons. Here's an example of what I was trying to do:\r\n\r\n```r\r\nsave_settings <- function()\r\n  {\r\n    xs <- seq(1,100,by=1)\r\n    result<-lapply(xs,function(x){\r\n      observeEvent(input[[paste0(x,\"_save\")]], {\r\n            if(!(input[[paste0(x,\"_save\")]]==0)){\r\n\t\t# Save something for this value of x.\r\n\t\t#input[[paste0(x,\"_save\")]] <- 0 # Could be a nice place to be able to reset to 0.\r\n            }\r\n          }\r\n        }\r\n        message(paste0(x,\"_save: \",input[[paste0(x,\"_save\")]]))\r\n      })\r\n      input[[paste0(x,\"_save\")]]\r\n    })\r\n    return(result)\r\n  }\r\n})\r\n```\r\n\r\nI could see the 'reset' to zero being useful in this case, but perhaps there's a better way of doing this.\r\nHas anyone done something similar?"}}