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

468
Views
TypeError: this.byId(...).close no es una función

el código es de [tutorial de SAP UI5][1] y código con brandon en youtube. Recibo este error. Cerrar no es una función. Probé de diferentes maneras y no pude encontrar una solución.

Siguiente.controlador.js

 sap.ui.define([ "sap/ui/core/mvc/Controller", "sap/m/MessageToast", "sap/ui/core/Fragment"], function (Controller, MessageToast, Fragment) { "use strict"; return Controller.extend("sap.ui.demo.walkthrough.controller.HelloPanel", { onShowHello : function () { // read msg from i18n model var oBundle = this.getView().getModel("i18n").getResourceBundle(); var sRecipient = this.getView().getModel().getProperty("/recipient/name"); var sMsg = oBundle.getText("helloMsg", [sRecipient]); // show message MessageToast.show(sMsg); }, onOpenDialog : function () { if (!this.pDialog) { this.pDialog = this.loadFragment({ name: "sap.ui.demo.walkthrough.view.HelloDialog" }); } this.pDialog.then(function(oDialog) { oDialog.open(); }); }, onCloseDialog : function () { // note: We don't need to chain to the pDialog promise, since this event-handler // is only called from within the loaded dialog itself. this.byId("HelloDialog").close(); } });});

HelloDialog.fragmento.xml

 <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"> <Dialog id="helloDialog" title="hello {/recipient/name}"> <beginButton> <Button text="{i18n>dialogclose}" press=".onCloseDialog"/> </beginButton> </Dialog></core:FragmentDefinition>

Por fin, acabo de copiar el mismo código pero obtengo el mismo error ".close is not a funtion" [1]: https://sapui5.hana.ondemand.com/#/topic/4da72985139b4b83b5f1c1e0c0d2ed5a

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

0

En el método de close , ha escrito this.byId("HelloDialog").close(); pero la id del diálogo es helloDialog .

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!