Announcement Announcement Module
Collapse
No announcement yet.
problems with validations Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problems with validations

    Hi,
    I have the problem with validations.
    My reequirement is the TextField of form should accept only int values, not null and String values. The following method i have written in the subclass of MultiActionController is working only for null values. If i enter any String values in the TextField then it is replacing with null, but the proper message should be displayed insteadof and prompt should be within that field.

    Code:
    protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object command) throws Exception { 
            ServletRequestDataBinder binder = null; 
            if (command instanceof DeviceInstanceVO) { 
               binder = new ServletRequestDataBinder(command, "command"); 
               binder.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, true)); 
          } 
            return binder; 
       }
    Please let me know what changes i have to do in the code.
    Thanks in advance.

    srinivasrao
Working...
X