cancel
Showing results for 
Search instead for 
Did you mean: 

Binding Items in a Dialog ...

0 Kudos

Hi, i'm trying to bind items in my fragment..

the table in my main view is like this...

_loadContent: function(context) {
        let tbGenerations = this.getView().byId("tbGenerations");
        let template = tbGenerations.getBindingInfo("items").template;

        let path =
          "gia_es_odata>/CONTROLE_TELA_PARAM(P_MANDT='" +
          context.MANDT +
          "',P_ORGSTR='" +
          context.ORGSTR +
          "',P_PERIODO='" +
          context.PERIODO +
          "',P_ANO='" +
          context.ANO +
          "')/Results";

        return new Promise((resolve, reject) => {
          tbGenerations.bindItems(path, template);

          tbGenerations.getBinding("items").attachChange(() => {
            resolve();
          });
        });

I want to do almost the same thing on the fragment.. how I do that?

_onHistory: function(context) {
    ...
}

Thank you .

junwu
Active Contributor
0 Kudos

what's your problem?

don't know where to write code?

0 Kudos

I dont know what to do to the data appears on the fragment

This is my btn event to open dialog ..

_onHistory: function(oEvent) {
        let tbHistory = this.getView().byId("tbHistory");
        let template = tbHistory.getBindingInfo("items").template;

        let path =
          "gia_es_odata>/CONTROLE_TELA_PARAM(P_MANDT='" +
          context.MANDT +
          "',P_ORGSTR='" +
          context.ORGSTR +
          "',P_PERIODO='" +
          context.PERIODO +
          "',P_ANO='" +
          context.ANO +
          "')/Results";

        return new Promise((resolve, reject) => {
            tbHistory.bindItems(path, template);

            tbHistory.getBinding("items").attachChange(() => {
            resolve();
          });
        });

        if (!this._oHistoryDialog) {
          this._oHistoryDialog = sap.ui.xmlfragment(
            "tax4b.gia_es.ui.view.HistoricoGeracao",
            this
          );
          this.getView().addDependent(this._oHistoryDialog);
        }

        this._oHistoryDialog.open(oEvent.getSource());
      },

maheshpalavalli
Active Contributor

Hi Carlos Henrique de Toledo

Your question is not clear. If possible could you provide a "detailed" steps of your query and what you want to acheive.

BR,

Mahesh

Accepted Solutions (0)

Answers (1)

Answers (1)

jorge_cabanas
Participant
0 Kudos

Hi Carlos,

The controller will be the same for the fragment. Look at the official doc:
https://sapui5.hana.ondemand.com/#/topic/4da72985139b4b83b5f1c1e0c0d2ed5a