Enabling creation
When selecting a component to link, the user can be prompted to create a new component.
To enable this, the creation
option accepts indexing phases during which the user can create a new component.
var plugin = new LinkFreeListPlugin({
toPopulate: 'RH_OfferLink',
category: 'TASK',
classId: 'JobOffer',
tagsToDisplay: ['RH_Service', 'RH_Job'],
title: labelsAPI.getLabel("suggestOfferTitle"),
description: labelsAPI.getLabel("suggestOfferDescription"),
creation: { phases: ['INSERT', 'MODIFY']}
});
plugin.bind();
Reacting to the selection
When selecting a component offered by this plugin, it may be necessary to react to it in order to access information on the selected component.
This information can be used to replicate information about the component being indexed, or to propose additional actions to the user.
The selector
option can be used to provide a function called up when the selected component is selected.
var plugin = new LinkFreeListPlugin({
toPopulate: 'RH_OfferLink',
category: 'TASK',
classId: 'JobOffer',
tagsToDisplay: ['RH_Service', 'RH_Job'],
title: labelsAPI.getLabel("suggestOfferTitle"),
description: labelsAPI.getLabel("suggestOfferDescription"),
selector: function(component){
console.info('The component '+component.getId()+' has bee selected!');
}
});
plugin.bind();