cancel
Showing results for 
Search instead for 
Did you mean: 

Aikau Dashlet data exchange

janaka1984
Star Contributor
Star Contributor
Hi all

i used aikau dashlet . i need to pass remote.call() data in to dashlet (hellodashlet) from controller. how can i do it????????


controller has widget which is used to render dashlet

example.get.js >>>>>>>>>>>>>>>>>>>>>>>.

var x = remote.call();
model.jsonModel = {

    rootNodeId: args.htmlid,
   
     services: [
         {name:      "alfresco/services/SearchService"}//,
      
    ],
    widgets: [
    {
         id: "HELLO_DASHLET",
         name: "idashlets/HelloDashlet",
         
    }
    ]

HelloDashlet.js>>>>>>>>>>>>>>>>>>>>>>>>>>

widgetsForBody: []
3 REPLIES 3

janaka1984
Star Contributor
Star Contributor
id: "HELLO_DASHLET",
name: "idashlets/HelloDashlet",
config:
{
   param : value
}


we can refer this value at build rendering() in dashlet JS -> this.param

gravitonian
Star Collaborator
Star Collaborator
Hi,

See the following link for an example of how to implement a custom service: https://docs.google.com/document/d/1q25jA5EQ5PRYekr8tpM3ELlwOQ8Ht3Ng6D4VWsKoZtY/pub#h.fd4u4w62hllf
and how to use events to communicate between widgets.
See the following link for example of how to get data and show in widget: https://docs.google.com/document/d/1q25jA5EQ5PRYekr8tpM3ELlwOQ8Ht3Ng6D4VWsKoZtY/pub#h.qqlnf8xr8sjs

The principle is the same for Aikau Pages and Aikau Dashlets, they both use Aikau Widgets.

ddraper
World-Class Innovator
World-Class Innovator

The data that you get back from the remote call can be passed into the widget as a configuration attribute. You should be making the remote call in your JavaScript controller for your WebScript and will then be able to reference data from the response and assign it into the model that is used to render Aikau content.

I guess it really depends what the data is that you're retrieving - so for example if you're just trying to embed an HTML response into an Aikau dashlet then this isn't going to work. Your dashlet will need to contain the Aikau widgets that you wish to be rendered and the data should be used to configure them.