cancel
Showing results for 
Search instead for 
Did you mean: 

Use Odata recovered in table

diego_a
Participant
0 Kudos

Hi,

I want to add data to the table model that has already been recovered in the component.js

odata in this model using the method expand_entity, loading all tables.

step as the recovered data is viewed in the image I want to pass data to the table that are under charasteristicSet.

The idea is not to make a get to the gateway to retrieve the data.

  Code:

  var tableOperaciones= this.getView().byId('idoperaciones');

  var operaciones = "/OperationsSet(Insplot='" + sObjectId + "',Inspoper='0010')"; //OperationsSet(Insplot='000000000001',Inspoper='0010')

  tableOperaciones.setModel( this.getModel());

  tableOperaciones.bindElement(operaciones);

  View

  <Table id="idoperaciones" inset="true" >

  <columns>

  <Column width="3em">

  </Column>

  <Column>

  <Text text="{i18n>multi.summary.title}" />

  </Column>

  <Column minScreenWidth="Tablet" demandPopin="true">

  <Text text="{i18n>multi.summary.createdBy}" />

  </Column>

  <Column minScreenWidth="Tablet" demandPopin="true">

  <Text text="{i18n>multi.summary.dueDate}" />

  </Column>

  </columns>

  <items>

  <ColumnListItem vAlign="Middle" id="LIST_ITEM">

  <cells>

  <Text text="{TxtOper}"/>

  </cells>

  </ColumnListItem>

  </items>

  </Table>

Accepted Solutions (0)

Answers (1)

Answers (1)

saurabh_vakil
Active Contributor
0 Kudos

Hi,

You need to set the items property within the table and provide the binding path, something like below:


<Table id="oTable" items="{path:'modelName>/Invoices'}" .... />

Regards,

Saurabh

diego_a
Participant
0 Kudos

Hi Saurabh

as you would have to settle for

LOTUS Operation-> Operation Characteristic-> Field Evaluation

diego_a
Participant
0 Kudos

Hi,

How to recover the values "Evaluation" in the JSON?

the development

  Json Odata Gateway

  {

  "d" : {

    "results" : [

      {

        "__metadata" : {

          "id" : "http://odata/LotsSet('000000497417')",

          "uri" : "http://odata/LotsSet('000000497417')",

          "type" : "odata.Lots"

        },

        "Insplot" : "000000497417",

        "DelivNoteDelivNumb" : "",

        "InsplotSize" : "800.000",

        "InsplotBaseUom" : "KG",

        "MatDoc" : "5004059328",

        "Center" : "0501",

        "CreatDate" : "\/Date(1459209600000)\/",

        "LotToOperation" : {

          "results" : [

            {

              "__metadata" : {

                "id" : "http://odata/OperationsSet(Insplot='000000497417',Inspoper='0010')",

                "uri" : "http://odata/OperationsSet(Insplot='000000497417',Inspoper='0010')",

                "type" : "odata.Operations"

              },

              "Insplot" : "000000497417",

              "Inspoper" : "0010",

              "TxtOper" : "Inspección Visual",

              "OperationToCharacteristic" : {

                "results" : [

                  {

                    "__metadata" : {

                      "id" : "http://odata/CharacteristicsSet(Insplot='000000497417',Inspoper='0010',Inspchar='0070')",

                      "uri" : "http://odata/CharacteristicsSet(Insplot='000000497417',Inspoper='0010',Inspchar='0070')",

                      "type" : "odata.Characteristics"

                    },

                    "Insplot" : "000000497417",

                    "Inspoper" : "0010",

                    "Inspchar" : "0070",

                    "Evaluation" : "R1",

                    "UpTolLmt" : "",

                    "LwTolLmt" : ""

                  },

   {

                    "__metadata" : {

                      "id" : "http://odata/CharacteristicsSet(Insplot='000000497418',Inspoper='0010',Inspchar='0070')",

                      "uri" : "http://odata/CharacteristicsSet(Insplot='000000497418',Inspoper='0010',Inspchar='0070')",

                      "type" : "odata.Characteristics"

                    },

                    "Insplot" : "000000497418",

                    "Inspoper" : "0010",

                    "Inspchar" : "0070",

                    "Evaluation" : "R2",

                    "UpTolLmt" : "",

                    "LwTolLmt" : ""

                  }

                ]

              }

            }

          ]

        }

      }

  ]

  }

}

  XML View DEtail

  <Table id ="id_table" >

  <columns>

  <!--Product description-->

  <Column minScreenWidth="Tablet" demandPopin="true" width="30%">

  <header>

  <Label text="Table example" />

  </header>

  </Column>

  </columns>

  <ColumnListItem id ="ItemList">

  <cells>

  <!--Product description-->

  <Text text="{Evaluation}"  />

  </cells>

  </ColumnListItem>

  </Table>

  Code controller view detail

  this.oItemTemplate = this.byId("ItemList").clone();

  var oItemTable = this.byId("id_table");

  var path2 = sEntityPath + "/LotToOperation(Insplot='"+oParameters.arguments.id+"',Inspoper='0010')/OperationToCharacteristic";

  oItemTable.bindItems({

  path: path2,

  template: this.oItemTemplate

  });

regards

Diego