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

Return value of RM.Client.setSelection(...)

Hello all!

is there a way to find out if RM.Client.setSelection(...) has really selected the artifacts desired?
Background: the function does not select anything when the artifacts are currently not displayed (e.g. hidden hierarchy level, filtered, etc).
The function seems to always return 'undefined'

Thank you!

0 votes



One answer

Permanent link
There are two ways to check:
 - the function returns false of any of the artefacts cannot be selected for any reason, and doesn't modify the current selection, so if you have nothing selected to start with then nothing will be selected afterwards
 - the function triggers the ARTIFACT_SELECTED RMEvent if successful

So firstly you can check for a return of false, but you can also use the RMEvent.subscribe() function to register a callback to see what's been selected.


0 votes

Comments
Thanks for your feedback. I expected, that there is a return value. However, I don't get a return value when calling setSelection(...), but always 'undefined'

var retValu = RM.Client.setSelection(row.ref);
console.log (retValu);

I am running 6.0.6 iFix009, is there any issue known, or is it me not doing it right?

In JavaScript, an undefined is considered to be false (or falsy, to be precise) but I would have expected it to return an actual false.

Can you post your full code snippet? I would like to see where row.ref is defined and how it's being set.

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,938

Question asked: Jul 04 '19, 9:51 a.m.

Question was seen: 1,417 times

Last updated: Jul 08 '19, 7:34 p.m.

Confirmation Cancel Confirm