cancel
Showing results for 
Search instead for 
Did you mean: 

Data Binding Issue using XML view

former_member269453
Participant
0 Kudos

Hi...

I am facing a certain issue. Please have a looh.

requirement: data needs to be populated in a List suing a XML view

What Done : i have created App View and the model has been set in init function of the app controller.

                    onInit : function() {

               sap.ui.getCore().setModel(

                 new sap.ui.model.json.JSONModel("model/app.json"));

                        

                  i have created a xml view 

          <List headerText="Product Overview"

            items="{ 

                path: '{/SalesOrderCollection}' 

                           }">

            <StandardListItem title="{SoId}"

            type="Navigation" press="handleProductListItemPress" />

            </List>

Output : But in the List No data comes....

Regards

Dipankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

var oModel = new sap.ui.model.json.JSONModel("model/app.json")

this.getView().setModel(oModel);

And the path should be

path: '/SalesOrderCollection'

former_member269453
Participant
0 Kudos

Thanks indrajit.. but still the data is not coming..

Changes Made :

onInit: function() {

  var oModel = new sap.ui.model.json.JSONModel("model/app.json");

  this.getView().byId("idList").setModel(oModel);

  },

Former Member
0 Kudos

var oModel = new sap.ui.model.json.JSONModel("model/app.json")

this.getView().setModel(oModel);

And the path should be

path: '/SalesOrderCollection'

Answers (4)

Answers (4)

former_member269453
Participant
0 Kudos

Hi...

i Used this. but still i get NO Data...

<List  id="idList" headerText="Product Overview"

  items="{/SalesOrderCollection }">

but on using the other solution it works fine.. thank you..

former_member269453
Participant
0 Kudos

Hi.. it would be really nice if u give the reasons also. that why i need to do it.. it will be helpful...

Former Member
0 Kudos

Hi,

use,


<listheaderText="Product overview"

items="{/SalesOrderCollection}">

remove the "path" inside the items in ur code and try,

former_member269453
Participant
0 Kudos

Hi indrajith.. Thanks for you reply...

COuld you please tell me why you used the path  :'/salesordercollection' ;

instead of {'/salesordercollection'}..

it would be much appreciated if u could explain me..

Former Member
0 Kudos

if you are binding it using "path" attribute , then

path: '/SalesOrderCollection'

If you want to binding using "items" , then

items="{/SalesOrderCollection}">