Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
shreyansjain
Posts: 146
Registered: ‎07-03-2013
My Device: BB 9360

index path for listItem under Context Actions

Hi, 
So, i have a standardList and currently, have context actions enabled, but i was wondering, how can we get the indexPath and its sub objects of the selectedItem. 

 

for ListItem trigerred signal, i got it working by:

var selectedItem = dataModel.data(indexPath);

and if I want to invoke functions for that dataModel, i would just use:

selectedItem.uniqueID

if I do something similar in Context Actions, i get an error "selectedItem is not an object". 

var selectedItem = listView.dataModel.data(listView.selectionList());

 and this way, 

CAN'T invoke:
selectedItem.uniqueID

 

Any ideas?

 

Thanks!

 

 

Regular Contributor
lunaplena
Posts: 205
Registered: ‎06-11-2013
My Device: Blackbery z10

Re: index path for listItem under Context Actions

There is a difference between. What is the return type of data() method in both the epressions,check the return type.

dataModel.data(indexPath);
and
listView.dataModel.data(listView.selectionList());
Developer
shreyansjain
Posts: 146
Registered: ‎07-03-2013
My Device: BB 9360

Re: index path for listItem under Context Actions

Yeah, they doesn't return the same data. 

Anyways, the way i got it to get the data items for a selected List for Context Menu is by putting a context menu property in the same container as standard list item, but the problem is:

 

it can't find the invokable functions defined in Qt and also, can't I push page to a navigationPane from context menu, becuase i get the similar below error (instead of _app, i have "navPane").

_app.callMyfunction();

 Returns "_app " symbol not defined. also, I can't call the parent listView (by its id). 
why is context menu designed so weirdly?

 

Thanks!