Showing results for 
Search instead for 
Did you mean: 

SAPUI5: Uncaught TypeError: c.getPath is not a function

Former Member
0 Kudos

Hello Experts,

I try to bind data in an array to a list and table as in 10 SAP exercise document

However, I face the issue Uncaught TypeError: c.getPath is not a function and No data is found on either the list or table. Any idea is appreciated. Thank you very much.

My xml code

<ObjectHeader title="{MaterialId}">
<ObjectAttribute text="{Name}" />    //it binds successfully

<List id="classList" mode="{device>/listMode}" itemPress="handleListSelect" items="{Classification}"> //no data found
<ObjectListItem type="Active" press="handleListItemPress" title="{ClassId}">

My navigate and binding code

var context = evt.getParameter("listItem").getBindingContext().getObject();"MaterialDetail", context);


var page = app.getPage(pageId);



My context:

Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos

If you send object you may can't bind with the path try like this,

var context = evt.getParameter("listItem").getBindingContext();

this thread may help you,

Answers (3)

Answers (3)

Active Contributor
0 Kudos

But you are doing

var context = evt.getParameter("listItem").getBindingContext().getObject();

just do

var context = evt.getParameter("listItem").getBindingContext();

object is not a context, context is Path+Model

Active Participant
0 Kudos


Change items="{Classification}" to items="{/Classification}" in List definition.

So, it could be like this:

<List id="classList" mode="{device>/listMode}" itemPress="handleListSelect" items="{/Classification}">
     <ObjectListItem type="Active" press="handleListItemPress" title="{ClassId}" />


Sandro Ramos

Former Member
0 Kudos

I changed it as u suggested but i does not work Sandro. I suspect that my path is not correct but i dont know how to change it.

Active Contributor
0 Kudos

Perhaps you are using eclipse for development. And you have made error while pressing CTRL+C. When you have pressed CTRL+C at that time the copied data might has been replaced by c and now it's become c.getPath

See your whole code where you have used getPath method.

If this is not the case then post your code where you have used getPath method.