Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
Upload field that is fully managed by JavaScript (no upload to a server)

I want to add an import functionality to a SAPUI5 application. I don't need to upload the file to a server, since I only want to handle the file on the client-side. The FileUploader control that is supplied with SAPUI5 doesn't seem to support that.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

One can disable the automatic upload by not setting the uploadOnChange property to true, and then adding a change handler to the control. The change handler has access to the uploaded files via oEvent.getParameters().files, and can process the uploaded files. When the form that is inside the FileUploader control is never submitted, it won't try to upload the files.

<mvc:View
    controllerName="app.controller.Main"
    xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:unified="sap.ui.unified"
    displayBlock="true">
    <Shell id="shell">
        <App id="app">
            <pages>
                <Page id="page" title="{i18n>title}">
                    <content>
                        <unified:FileUploader id="ui5-uploader"/>
                    </content>
                </Page>
            </pages>
        </App>
    </Shell>
</mvc:View>
sap.ui.define([
    "sap/ui/core/mvc/Controller"
], function (Controller) {
    "use strict";

    return Controller.extend("app.controller.Main", {
        onAfterRendering: function() {
            var uploader = this.getView().byId("ui5-uploader");
            uploader.attachChange(function(oEvent) {
                oEvent.getParameters().files[0].text().then(
                    function(sContent) {
                        console.log(sContent);
                    }
                );
            });
        }
        
    });
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda