It's all about the answers!

Ask a question

Dojo script to create dependent enumeration


Chandra Prakash k (21215) | asked Feb 08 '18, 8:13 a.m.
retagged Feb 22 '18, 2:06 p.m. by Ken Tessier (84117)

 Hi,


I'm trying to create dependent enumeration using dojo script (for one internal requirement). I have tried the fillowing dojo script (script based value set), but it didn't worked.


dojo.provide("featuregroup.dojo");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("featuregroup.dojo", null, {

    getValueSet: function(attributeId, workItem, configuration) {
    
        var domain= workItem.getValue("com.visteon.enum.domain");
        var functionalblockoptions= [];
        
if ((domain === "com.visteon.domain.literal.l9")) { 
            functionalblockoptions.push("com.visteon.functional.block.literal.l3");
            functionalblockoptions.push("com.visteon.functional.block.literal.l4");
            functionalblockoptions.push("com.visteon.functional.block.literal.l5");
            functionalblockoptions.push("com.visteon.functional.block.literal.l6");
            functionalblockoptions.push("com.visteon.functional.block.literal.l7");
            functionalblockoptions.push("com.visteon.functional.block.literal.l8");
functionalblockoptions.push("com.visteon.functional.block.literal.l9");
            functionalblockoptions.push("com.visteon.functional.block.literal.l10");
}else if((domain === "com.visteon.domain.literal.l8")) {        
functionalblockoptions.push("com.visteon.functional.block.literal.l11");
functionalblockoptions.push("com.visteon.functional.block.literal.l12");
functionalblockoptions.push("com.visteon.functional.block.literal.l13");
functionalblockoptions.push("com.visteon.functional.block.literal.l14");
functionalblockoptions.push("com.visteon.functional.block.literal.l15");
functionalblockoptions.push("com.visteon.functional.block.literal.l16");
}
functionalblockoptions.push("com.visteon.functional.block.literal.l1");
        return functionalblockoptions;
    }
});
})();
================================
Please let suggest if any other process we have to achive this requirment. 

One answer



permanent link
Matt Muller (59813674) | answered Feb 08 '18, 8:20 a.m.

Comments
Chandra Prakash k commented Feb 13 '18, 5:37 a.m.

 Hi Matt,


Out of the box option is working. but we wanted to do the same funtionality using the dojo.
Because, we have a requirement where the dependent enumeration has more number of literals (now it is morethan 50) it will keep on increase. 
Each time we open out of the box functionality, its taking toomuch of time to load the enumeration fields. assuming because of more number of enumerations available in the project area.
So we thought of using dojo script, which will be easy to configure and maintain the list (easy to add when additional literals needed).

Thanks in advance.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.