Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

B&S: Customer ID

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
Specifications says:

The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale.

Does it mean that customer id MUST have all eight digits without leading zeros? OR at max. 8 digits and min. 1 (excluding zero)?

It seems sticking to all 8 digits is a better option. Please comment!

Thanks
Shafique
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Muhammad,

Funnily enough, I coded that yesterday.

I read it that it MUST be 8 digits (including 0), so "00000001" is okay but "1" is not.

I just used a JFormattedTextField with MaskFormatter("########").

And "0" is a digit according to MaskFormatter (the API says # "is Any valid number, uses Character.isDigit").
 
Muhammad Shafique
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Brian,
JFormattedTextField is cool for text formatting.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic