我有一个带有活动按钮的表单,问题是我想重置此表单中的按钮 output$exampleFasta = 0
但它抛出异常,我该如何更改变量的数据?或者如果存在类似renderImage的东西,它可以给id等特定属性提供信息 .
的index.html
<form class="span12 menu-med-upload">
<div class="row-fluid">
<h3>Upload File .fasta</h3>
<div class="custom-input-file btn btn-inverse">
<input type="file" size="1" name="fileFasta" id="fileFasta" class="input-file" />
Select File
</div>
<img src="/static/img/check.png" class = "custom-input-check">
<div class="span12"></div>
<textarea class = "span12" rows = "10" style="resize: none;" id="textAreaFasta">
</textarea>
</div>
<button id="uploadFasta" type="button" class="btn btn-inverse action-button" >Upload File</button>
<button id="exampleFasta" type="button" class="btn btn-inverse action-button" >Example</button>
</form>
server.R
output$table <- renderText({
if(input$exampleFasta != 0 && input$uploadFasta == 0){
return(myRenderTable(matrixProteinExample(),"table",""))
}
if(input$uploadFasta != 0){
return(myRenderTable(matrixProtein(),"table",nameFile))
}
})
用这样的东西改变 . 但这是错误的 .
output$table <- renderText({
if(input$exampleFasta != 0 && input$uploadFasta == 0){
output$exampleFasta <- 0
return(myRenderTable(matrixProteinExample(),"table",""))
}
if(input$uploadFasta != 0){
return(myRenderTable(matrixProtein(),"table",nameFile))
}
})
1 回答
如果你问的是如何判断最近点击了哪个actionButton(如果有的话!),那么重置为0就不是这样做的了 . 而是这样做: