It's all about the answers!

Ask a question

[HOW TO] Disable (read-only) an Attribute by scripting.


Alvaro Riera (4021418) | asked Oct 13 '11, 3:59 a.m.
Hi all!

I have done a script to disable an attribute in a specific state.
I have created the script into the Default Values, dont know if its ok
Here is the code:

dojo.provide("com.example.common.TestDisable");

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

(function()
{
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.common.TestDisable", null, {
setDisabled: function(attributeId, workItem, configuration) {
alert('inside disabled');
var state= workItem.getValue(WorkItemAttributes.STATE);
alert('state: ' + state);
if ((state === "ECI_defecto.state.s8"))
{
return true;
}
else
{
return false;
}
}
});
})();




Recharging the page i only see the 'start' alert.
The alert('inside disabled'); doesnt appear and i dont know why...

How can i disable (read only) an attribute of my page ???
is possible to access to an element by dojo.byId('NameOfElement') ?
Can
someone help me pls?
Thank you all

Be the first one to answer this question!


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.