Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
Cargue el campo que está completamente administrado por JavaScript (no se carga a un servidor)

Quiero agregar una funcionalidad de importación a una aplicación SAPUI5. No necesito cargar el archivo en un servidor, ya que solo quiero manejar el archivo en el lado del cliente. El control FileUploader que se proporciona con SAPUI5 no parece admitir eso.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Se puede deshabilitar la carga automática al no establecer la propiedad uploadOnChange en verdadero y luego agregar un controlador de change al control. El controlador de change tiene acceso a los archivos cargados a través oEvent.getParameters().files y puede procesar los archivos cargados. Cuando el formulario que está dentro del control FileUploader nunca se envía, no intentará cargar los archivos.

 <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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!