It's all about the answers!

Ask a question

Is there a UI validation capability in RTC for multiple selections using stringList attribute type with Value Set Picker presentation?


Robert Stawicki (5844) | asked Aug 17 '17, 4:48 p.m.

We were looking for a solution to allow multiple selections with our java external reference Value Set Provider. We did some test code utilizing a stringList attribute and a Value Set Picker presentation. This got us to be able to make multiple choices, and remove them, but then we got to the question of validation.
We need the ability to validate each choice for format as well as how many choices were made (to set a limit). I'm aware we could have put that validation in a work item save operation advisor or participant (pre / post processing). We have those constructs, and have the capability to do that.
However, it is preferable to have UI validation prior to a user entering data into multiple attributes and not find out until a save something was not valid. We went with a work around (selector / collector string attribute pairs) that afforded us UI validation for now.
String attributes have regular expression or scripted validators. Does such a thing exist (or will it) for stringList?

One answer



permanent link
Ralph Schoon (63.5k33646) | answered Aug 18 '17, 2:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You would have to write your own attribute customization validators e.g. based on Java or JavaScript.

For Java you can access list type attributes. See Attribute Customization – Java Based Value Providers, Conditions and Validators for some examples and how to. In JavaScript, I have not found out how the list is passed. There was a post here around that topic not too long ago, but I unfortunately I can't find that any more. If you can figure what type of data you get for list attributes JavaScript might work, otherwise Java would be my choice.


Comments
Robert Stawicki commented Aug 18 '17, 12:54 p.m.

Another light goes on - while we have used java Value Set Provider extensions, I was not aware until now we could also provide a java plugin for a Validator. I may have to play with that at some point, and see what value type a string list attribute produces internally, and validate choices based on that. (The javaScript Validator - and I think we've used this - seems limited in the attribute types it handles, or as you indicated, is not easy to figure out how to handle a *List attirbute.)
A further question then, ...
Are there any limitations using a java Validator extension? We require the capability in both eclipse and web clients. We occasionally run into inconsistencies. We have a java Value Set Provider that works in both clients, so can I assume a java Validator is consistent?
Thanks.


Ralph Schoon commented Aug 18 '17, 2:41 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

To work with the Eclipse clients, the Java attribute customization needs to be deployed in the Eclipse client - see my blog.

I have recently learned that there might be differences in how the JavaScript and Java stuff works under the hood (or bonnet), so you would have to spend some time on testing.

Note: I have usually no more access to source code than you guys have. So all the stuff in my blog I found out by searching in the code using the SDK. There are examples for almost everything.

Note, all the built in attribute customization is written in Java -> exampes.

Your answer


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.