cancel
Showing results for 
Search instead for 
Did you mean: 

Ui5 binding an array

0 Kudos

Hello experts,

I am new to UI5 and have query.  I have to display the following format in table

[{"AddressFacilityPf": "Ronda de la Comunicación s/n, Edificio Oeste 1 4P","ContactNumber": "914820997","PrivateContribution": "false","TaxCodeTME": "A78923125","TaxCodeTsol": "A78053147","TaxIDCodeLocTME": "A78923125","TaxIDCodeLocTdE": "A82018474","TaxIDCodeLocTsol": "A78053147","TaxIDFacilityTsol": "A78053147","TaxIdPlatformTME": "B82857053","TaxIdPlatformTdE": "B82857053","TaxIdPlatformTsol": "B82857053","TrainingOrgEnt": "false","nombreCentroTME": "TELEFONICA MOVILES ESPAÑA","nombreCentroTdE": "TELEFONICA DE ESPAÑA","nombreCentroTsol": "TELEFONICA SOLUCIONES","id": 524798,"legalEntity": "FT","itemCode": "TE10010","itemCode1": "10010","offeringStartDate": "4/10/2015","offeringEndDate": "5/10/2015","deliveryMethod": "ONSITE","numberOfParticipants": 25,"facilityName": "0156_28000337","locationName": "0156_28200337","creditHours": 12,"firstDayMorningStartDateTime": "10:00:00","firstDayMorningEndDateTime": "14:00:00","firstDayAfternoonEndDateTime": "17:00:00","daysOfTeaching": "XJ","creationDate": "07/12/2015","lengthOfOffering": 12,"offeringCloseDate": "19/12/2015","offeringCancelledDate": "19/12/2015","totalCount": 77,"offeringid": "0156_87725172","itemSecondaryID": "","updatedOn": "19/12/2015"}]


Here the issue is that Instructors i an array and hence returns a row in itself. So i am not sure to bind this particular table.

This is my XML view




                 <Table

                           rows="{/}"

                           id="Instructor"

                           selectionMode="MultiToggle"

                           visibleRowCount="7">

                           <columns>

                                  <Column width="11rem">

                                         <m:Label text="{i18n>ItemSecondaryID}"/>

                                         <template>

                                                <m:Text text="{itemCode1}"/>

                                         </template>

                                  </Column>

                                  <Column width="11rem">

                                         <m:Label text="{i18n>OfferingScheduledNewID}"/>

                                         <template>

                                                <m:Text text="{offeringid}"/>

                                         </template>

                                  </Column>

                                  <Column width="11rem">

                                         <m:Label text="{i18n>NationalId}"/>

                                         <template>

                                                <m:Text text="{instructors/instructorID}"/>

                                         </template>

                                  </Column>

                                  <Column width="11rem">

                                         <m:Label text="{i18n>InstructorFname}"/>

                                         <template>

                                                <m:Text text="{instructors/instructorFName}"/>

                                         </template>

                                  </Column>

                                  <Column width="11rem">

                                         <m:Label text="{i18n>InstructorLname}"/>

                                         <template>

                                                <m:Text text="{instructors/instructorLName}"/>

                                         </template>

                                  </Column>    

                                  <Column width="11rem">

                                         <m:Label text="{i18n>InstructorMname}"/>

                                         <template>

                                                <m:Text text="{instructors/instructorMName}"/>

                                         </template>

                                  </Column>

                                  <Column width="11rem">

                                         <m:Label text="{i18n>Comments}"/>

                                         <template>

                                                <m:Text text="{instructors/observations}"/>

                                         </template>

                                  </Column>

                                  <Column width="11rem">

                                         <m:Label text="{i18n>HoursPerInstructor}"/>

                                         <template>

                                                <m:Text text="{instructors/hoursPerInstructor}"/>

                                         </template>

                                  </Column>

                                  <!-- <Column width="11rem">

                                         <m:Label text="{i18n>AddressPFTelephone}"/>

                                         <template>

                                                <m:Text text="{AddressPFTelephone}"/>

                                         </template>

                                  </Column> -->

                           </columns> 

Accepted Solutions (0)

Answers (2)

Answers (2)

karthikarjun
Active Contributor
0 Kudos

Well,

Add this record to JSON Model.

Bind it into sap.ui.getCore().setModel(JsonModel).

Use Binding concepts to append this record in your table.

Regards,

Karthik A

former_member182862
Active Contributor
0 Kudos

Sorry Tarun

Where is instructors in your JSON?

Thanks

-D