It's all about the answers!

Ask a question

Ability to specify fixed-length or max-length String attrs?


Dan Rivett (1211115) | asked Feb 19 '09, 10:31 a.m.
I've done a search of the forum and work items, and couldn't find an answer so thought I'd post.

Is there a way to specify a String custom attribute to have a maximum length (ie number of characters)? It would be useful for the Strings displayed in the Work Item editors (both RTC and Web) to size the String box accordingly.

For example I have a few one character long fields (such as TYPE which is an alphabetical character). It would be great for the display of this field to be sized to just one character (or slightly larger, but not take up 20 odd characters, and not resize (grab/fill) as the parent resizes).

It would also be great for the editor to stop accepting input past the maximum length specified so that a user doesn't inadvertantly type in too many characters and scroll the String text box.

Obviously any validation of the contents would still be left up to pre-condition advisors, but limiting character entry past the maximum stated length seems appropriate.

This could be declared as a property to the String field in the editor declaration, such as 'max-length'.

This would be flexible enough to support one character long fields, and also longer String fields with a fixed/maximum length (we have another field (NAME) which is always 7 characters long).

As an extra request, it would be good to get CHAR or Character attribute type added as for the case where fields are only 1 character long. It's not necessary if it was patrolled through the max-length display attribute suggested above, but would be more efficient than using a smallString - why use 255 characters for a 1 character long field?

If I've missed something obvious, and it's already possible, apologies, I've only been using RTC for the past fortnight.

Many thanks in advance,
Dan

3 answers



permanent link
Dan Rivett (1211115) | answered Feb 19 '09, 10:43 a.m.
Just as a quick helper, both SWT and dojo appear to support limiting the number of characters entered in a text box.

SWT - http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/widgets/Text.html#setTextLimit(int)

Dojo - Using the basic HTML MaxLength property on the TextBox control.

I can raise an enhancement request with this information if Development feel it has merit. I certainly do, but I'm biased! :)

permanent link
Patrick Streule (4.9k21) | answered Feb 19 '09, 1:08 p.m.
JAZZ DEVELOPER
Just as a quick helper, both SWT and dojo appear to support limiting
the number of characters entered in a text box.

SWT -
http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/widgets/Text.html#setTextLimit(int)

Dojo - Using the basic HTML MaxLength property on the TextBox
control.

I can raise an enhancement request with this information if
Development feel it has merit. I certainly do, but I'm biased! :)

Yes, please create an enhancement request. This is certainly an aspect of
work item customization that does not fall directly within the general
topic of validation for which there are work items.

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Dan Rivett (1211115) | answered Mar 19 '09, 1:16 p.m.
Thanks Patrick, I've created enhancement 74943 to track it.

Hopefully it's considered something that would be useful for the wider community too and should be done. Cheers.

Your answer


Register or to post your answer.