Button represents R with shiny

I try to implement a form to upload a file, but I get to work when I click the submit button, the problem is that I have a strange error, and I don’t know what it is, I made an example tutorial and it worked without problems, now I am implementing the same thing, but with index.html, and this does not work.

Error: "Error in if (input $ uploadFasta == 0) return (NULL): argument has length 0"

my index.html is similar:

<form class="span12 menu-med-upload">
    <div class="row-fluid">
        <center>
          <div class="custom-input-file btn btn-inverse">
            <input type="file" size="1" id="fileFasta" class="input-file" />
          </div>
        </center>
        <button id="uploadFasta" type="button" class="btn action-button shiny-bound-input" >go!</button>
    </div>
</form>

my .R server:

output$table <- renderText({
    if(input$uploadFasta == 0)
        return(NULL)
    myRenderTable()
})

Does anyone know what the problem is and thank for everyone and it is a pity if this topic was opened earlier, but I could not find.

+5
source share
1 answer

The action button is a custom input binding, and I bet it doesn't load.

global.R , server.R, :

addResourcePath(
    prefix='actionbutton', 
    directoryPath=system.file('actionbutton', 
                          package='shinyIncubator'))

index.html <head>:

<script src="actionbutton/actionbutton.js"></script>

( , </script> - <script />.)

+2

All Articles