cancel
Showing results for 
Search instead for 
Did you mean: 

Widget to render a list in line with Publishing Topic

npavlov
Confirmed Champ
Confirmed Champ

Hi,

I want to render a parameter whose value is an array of elements (each element has, for example, a name and an identifier). As a result, I should get a list of names (in a string separated by a comma), when you click on the name, you should publish a topic containing the identifier. Any ideas how to implement such a widget? 

Now I have a simple widget with html-links but I need to publish a topic instead of following a link.

1 ACCEPTED ANSWER

npavlov
Confirmed Champ
Confirmed Champ

I add publication function to each item of my list

{...

this._attach(itemNode, "ondijitclick", lang.hitch(this, this.onClick, item.name));
  ...
},
onClick: function alfresco_navigation_Link__onClick(name,evt) {
    event.stop(evt);
    if (this.publishTopic != null)
    {
        this.alfPublish(this.publishTopic, {name:name});
    }
}

(by analogy with the widget "alfresco/navigation/Link").

View answer in original post

1 REPLY 1

npavlov
Confirmed Champ
Confirmed Champ

I add publication function to each item of my list

{...

this._attach(itemNode, "ondijitclick", lang.hitch(this, this.onClick, item.name));
  ...
},
onClick: function alfresco_navigation_Link__onClick(name,evt) {
    event.stop(evt);
    if (this.publishTopic != null)
    {
        this.alfPublish(this.publishTopic, {name:name});
    }
}

(by analogy with the widget "alfresco/navigation/Link").

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.