Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RM.Event.subscribe(RM.Event.ARTIFACT_Selected...) does not recognize, if a requirement was selected via filter

I have implemented in my code the RM.Event.subscribe-function as followed:

let artRefs = RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED, function(artRef){
        artRefsList=[]
        artRefsList.push(artRef)    
        //console.log(artRefsList)
        callback()
    })

It works fine, if I check the checkboxes of the artifact manually. But if I use the search possibilities of ERM, the founded artifact is selected from ERM - but the subscribe-event does not work. 
How can I solve this issue?

Alternatively I can get all selected artifacts via getElementsByClassName("row-checked"). This works but how can I get then the ArtRef, which I need? Is there a function available like ref.toUri() - only the other way round: uri.toRef()?

Every hint will be welcome!

0 votes



One answer

Permanent link
The hint is in the event name - it will only fire if the artefact is SELECTED. It's got to be actually checked, not just highlighted.

It will fire if you create a filter or query and then select all the elements by using the check box in the top left of the column titles.

0 votes

Comments

If I search for an artifact by using the search option on the top the artifact is checked (checkbox is checked) and selected. (row-checked and row-selected). But the event is not fired? What is the reason behind?


Is there a function available like ref.toUri() - only the other way round: uri.toRef()?

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Jun 12 '24, 10:02 a.m.

Question was seen: 586 times

Last updated: Jun 14 '24, 2:01 a.m.

Confirmation Cancel Confirm