Widget to render a list in line with Publishing Topic

cancel
Showing results for 
Search instead for 
Did you mean: 
npavlov
Active Member II

Widget to render a list in line with Publishing Topic

Jump to solution

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 Solution

Accepted Solutions
npavlov
Active Member II

Re: Widget to render a list in line with Publishing Topic

Jump to solution

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 solution in original post

1 Reply
npavlov
Active Member II

Re: Widget to render a list in line with Publishing Topic

Jump to solution

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").