Languages

Menu
Sites
Language
retrieve own widget id

Using the guide over at https://developer.tizen.org/development/guides/web-application/application-management/application-information-and-controls/widget-information​ I am able to retrieve all widgets and its instances, but how does a widget know it's own id? How does the widget receive the data sent using sendContent?

Responses

2 Replies
André Reus

Hi~
You can find your own app by from your config.xml.

To receive data use, 

var successCallback = function(object)
{
   console.log("Data successfully retrieved");
};

var errorCallback = function(error)
{
   console.log("Error " + error.message);
};

instance.getContent(successCallback, errorCallback);

-Thanks 

Philippe Wechsler

​But this is the widget id, not the instance id. For example the user can instanciate the same widget multiple times. So there are 2 widget instances with the same widget id, the one you mentioned. But getInstances​ will then return 2 instances - how does a widget know which instance it is?