It's all about the answers!

Ask a question

how to display a error or warning message on the workitem with javascript / dojo ?


Olivier ROSET (5011) | asked Feb 19 '19, 9:03 a.m.
edited Feb 20 '19, 10:35 a.m.

 Hello,

In RTC, when we forget a mandatory field when creating a workitem, we have a nice red message at the top of the workitem screen.
Is it possible, in a Validator or DefaultValue or CalculatedValue script, to display a message of this type in the same place?
How to access the DOM of the RTC page from javascript?
Through dojo?

The real question is : is it possible, in (by example), a condition Script, to access the DOMof the current page displayed by RTC? I wanted to have access to a html element an be able to modify his innerHtml by document.getElementById("xx").innerHtml or some stuff like that. 


Comments
Ralph Schoon commented Feb 20 '19, 11:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I know that some have added hover information to the work item web UI using a theme. I have no example and I am convinced that you should stay well within the limits of https://jazz.net/wiki/bin/view/Main/AttributeValueProviders .


It is possible to create custom attribute presentations.

One answer



permanent link
Olivier ROSET (5011) | answered May 06 '20, 1:33 p.m.
One solution : 

 I know it's HORRIBLE and please, use it ONLY if you have no other solution :)

In my javascript I use a code like this : 

let balise = document.getElementsByClassName("validationMessageAnchor")[1];
balise.innerHTML = '<span style="display:block;.....etc...

This display a message just after the workitem type and Id on the top of the workitem screen. 
I know,I know.... it's BAD and not durable !!!! 

Sorry. :)


Your answer


Register or to post your answer.