Need help in IListContainerModel_Notify with EVT_MDL_LIST_CHANGE event | developer.brewmp.com Need help in IListContainerModel_Notify with EVT_MDL_LIST_CHANGE event | developer.brewmp.com

Developer

Need help in IListContainerModel_Notify with EVT_MDL_LIST_CHANGE event

Forums:

Hello Everyone,

I am creating listcontainer widget and attaching a listcontainermodel to it using model factory API where I provide 4 callback functions.

I want to display thumbnail images into my list dynamically.And I use APi IListContainerModel_Notify in which I send EVT_MDL_LIST_CHANGE.

Initially when my list is empty and want to insert new items I set the values as follows

PLEASE HAVE A LOOK AT MY CODE

ModelEvent pModelEvent,*pModelEvent1;
ListModelEvent *m_pListModelEvent;

pModelEvent.evCode = EVT_MDL_LIST_CHANGE;

/** pModel is of type IModel got from IListContainerModel_to_IModel(m_pApiLCM) **/

pModelEvent.pModel = pModel;

pModelEvent.dwParam = 0;

m_pListModelEvent->base = pModelEvent;
m_pListModelEvent->oldSize = 0;
m_pListModelEvent->newSize = 4;
m_pListModelEvent->pos = 0;

pModelEvent1 = ListModelEvent_to_ModelEvent(m_pListModelEvent);
IListContainerModel_Notify(m_pApiLCM,pModelEvent1);

After doing this I expect to see 4 items in my list but I see nothing.

I dont get callbacks of PFN_GET_ITEM_WIDGET and PFN_GET_ITEM_DATA for any element .
I get PFN_GET_NUM_ITEMS callback where I am giving new number of items

After this I get EVT_MDL_LIST_CHANGE event in my ModelListner which I have registered for my ListContainerModel.

If I set pos value to other than 0 I get PFN_GET_ITEM_WIDGET and PFN_GET_ITEM_DATA for item at index 0.

What should be the pos ,newSize and oldSize values if my list is initially empty and now it contains 'n' number of elements?

Am I using the ListContainerModel_Notify API properly?
What things are required to do once we get EVT_MDL_LIST_CHANGE in ModelDelListner function.
Right now I am just invalidating the listcontainer widget.

One more thing is If I use EVT_MDL_LIST_RESET and call IListContainerModel_Notify I am able to see all newly added 4 elements.

I want to know when values should do in pos,newSize and oldSize members of structure ListModelEvent

Thank you
-Pradnya

Hi,
Please refer to the document and sample code "Using ListContainer". This should answer your query about using the callback-based ListContainerModel.
https://brewmobileplatform.qualcomm.com/devnet/docviewer.jsp?method=show...
Thanks,
Sam.

Hi,
Please refer to the document and sample code "Using ListContainer". This should answer your query about using the callback-based ListContainerModel.
https://brewmobileplatform.qualcomm.com/devnet/docviewer.jsp?method=show...
Thanks,
Sam.