Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validwhen question

 
Jordan Smith
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
i need to valid a field only if another field is like cash field and my value if null or is an empty string.
so i wrote:

but i get an exception:
SEVERE: ValidWhen Error for field ' data.billToName' - line 1:62: unexpected char: '''
how can i solve it?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
odelya yomtov-glick wrote:
SEVERE: ValidWhen Error for field ' data.billToName' - line 1:62: unexpected char: '''
how can i solve it?

What is this "key" name ?

Unless and untill, you don't write down the key name in proper english, complier will throw exception
 
Jordan Smith
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i changed it and it still doesn't work..
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No need of this extra condition:

Checking for "null" itself check whether the field has value or not..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic