It's all about the answers!

Ask a question

How to implement multi-select value attributes and fields?


1
1
Morten Madsen (3032641) | asked Nov 07 '12, 10:30 a.m.
edited Nov 07 '12, 10:34 a.m. by Ralph Schoon (57.1k23642)
Hi,

since RTC 2.0 we have been trying to implement multi-selection fields in a proper way. We basically want to do the following:

1. Work items should be marked in some way with the business unit (customer) that this work item is relevant to. It can be relevant to many customers at once.

2. In RTC 3 we tried to used the way of "small string" attribute which would use a multi selection box presentation fed with business unit enumeration values. So far so good. But the queries would display BusinessUnitEnum.literal1 .... or something like that, so this was not working for getting an overview.

3. In RTC 4 I've played with the HTTP filtered value set and a String List attribute, which seems to work nicely. One drawback is that you can click "new..." and add any string what so ever.

Can you in some way disable that "New..." button, add a validator or in some way ensure that this value is ONLY from the value set provided by HTTP XML source?

Any other comment or ideas how to solve this? Any comments appreciated!

In advance, thanks a lot :-).

Accepted answer


permanent link
Millard Ellingsworth (2.5k12431) | answered Nov 07 '12, 7:49 p.m.
FORUM ADMINISTRATOR / JAZZ DEVELOPER
I spent some time this afternoon looking for an answer (and actually hacked a way that worked, at least for the web ui) but that won't actually help you at the moment (sorry). 

The StringList picker widget has a method that answers the question (should I show the New... button?) -- and it is currently hard-coded to say "yes". I hacked that in my development environment and I got a picker that only allows Select. This hack did not provide the same functionality in the Eclipse UI (though I expect a similar one would).

I was hoping that there would be a property on the String List editor presentation (something like showNew or allowUserSupplied) that you could set to false but there does not seem to be. I have filed Enhancement Request 240267 to add this feature. Feel free to comment there and +1 it if you like.


Millard
RTC Dev Team
Morten Madsen selected this answer as the correct answer

Comments
Morten Madsen commented Nov 08 '12, 1:34 a.m.

Thanks, I will follow that enhancement. Thanks a lot :-D!

4 other answers



permanent link
sam detweiler (12.4k6179201) | answered Nov 07 '12, 8:59 p.m.
there is really only one good way that I know of,

2. In RTC 3 we tried to used the way of "small string" attribute which would use a multi selection box presentation fed with business unit enumeration values. So far so good. But the queries would display BusinessUnitEnum.literal1 .... or something like that, so this was not working for getting an overview.

create the enum,
then edit the process source and change the generated IDs to match the text names of the enumerations.
then create the string definition to hold the values..

then queries look right..

but.. note that IDs are project wide, not tied to a workitem type..  so be careful with the names

Comments
Morten Madsen commented Nov 08 '12, 1:36 a.m.

That actually sounds like a nice way to do it, until the above enhancement is implemented. I will look into it.

One thing I did not mention though, is that this way makes it very hard to add new business units and the above solution would actually help this issue.

Your solution though will fit nicely with what we have now. I will definitely consider it. Thanks a lot for your suggestion :-).


permanent link
Phillip Piper (15812424) | answered Nov 30 '12, 11:58 a.m.
Even if you change the IDs though, this will help for queries but I think you still can't use on the attribute in the dashboard work item widgets, right? I think if you want to display any work item widgets that use a query they only list attributes which are non-string or basically of type which would have a finite number of values.

Has anybody figured out a way around this?

Comments
sam detweiler commented Nov 30 '12, 12:23 p.m.

Query or report layout of the results is ugly, correct.. because you have a STRING with multiple comma separated values..   not a nice list

you could fix this by creating special report gadgets that know to parse this field properly (IBM should have done that), but its a lot of work for maintenance.


Phillip Piper commented Nov 30 '12, 12:39 p.m. | edited Nov 30 '12, 12:40 p.m.

Thanks Sam.

Thinking some more on this...

Our issue was we couldn't use the Work Item Statistics widget or anything that shows a break down of the attribute by selected values. However, if using small or medium strings (as you mentioned in another thread) you could use "contains" to search for your more logically named IDs.

So I think one could workaround this type of widget by creating a series of individual queries which each query for a single ID or value from the multi-select list. Then you could use the Work Item Queries widget to list these and each should list the number of valid results in parentheses next to the name.

Not a great solution but it could be workable. I am suggesting this to be tested by a member of our team to see if it suits their needs.


permanent link
sam detweiler (12.4k6179201) | answered Nov 30 '12, 12:43 p.m.
correct, you would have to make reusable individual queries..  nice touch!

permanent link
Tom Malnar (23137) | answered Jun 26 '13, 11:16 a.m.
 If you plan on removing the new feature, can you also ensure the edit feature is gone too.   If you click on edit you can essentially make a new string.  Maybe under the hood they both share the same new code, but just in case I wanted to mention it.

Your answer


Register or to post your answer.