Announcement Announcement Module
Collapse
No announcement yet.
Validator and bind tag - newbie Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Validator and bind tag - newbie

    I have a problem using validator and bind tag. My code looks like seen below. Problem is that all fields except company field get "," (comma) as return value. Only error that is shown is for company field, which validated as last field in my validate method. Any pointers appreciated.


    Code:
      
     <spring&#58;bind path="client.name">
                <input type="text" name="name" value="$&#123;status.value&#125;"/>
                <span class="fieldError">$&#123;status.errorMessage&#125;</span>
            </spring&#58;bind>
    <spring&#58;bind path="client.company">
                <input type="text" name="name" value="$&#123;status.value&#125;"/>
                <span class="fieldError">$&#123;status.errorMessage&#125;</span>
            </spring&#58;bind>
    Code:
        
    public void validate&#40;Object obj, Errors errors&#41;
        &#123;
    
    
            ValidationUtils.rejectIfEmptyOrWhitespace&#40;errors, "name", "NAME_REQUIRED", "Name required."&#41;;
            ValidationUtils.rejectIfEmptyOrWhitespace&#40;errors, "email", "EMAIL_REQUIRED", "Email required."&#41;;
            ValidationUtils.rejectIfEmptyOrWhitespace&#40;errors, "type", "TYPE_REQUIRED", "Type required."&#41;;
            ValidationUtils.rejectIfEmptyOrWhitespace&#40;errors, "password", "PASSWORD_REQUIRED", "Password required."&#41;;
            ValidationUtils.rejectIfEmptyOrWhitespace&#40;errors, "company", "COMPANY_REQUIRED", "Company required."&#41;;
    
        &#125;

  • #2
    Problem is that all fields except company field get ","
    that is: if I submit empty values I get comma as result from ${status.value}

    Comment


    • #3
      for everyone experiencing same problem:
      I had duplicate names for my text fields within my form (copy-paste effort), so comma values were inserted as values for certain fields.

      take care all,
      -m

      Comment

      Working...
      X