Announcement Announcement Module
Collapse
No announcement yet.
Wizard form controller validation quiestion Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wizard form controller validation quiestion

    Is it possible to use commons validator with wizard form controller validating a page at a time .. ??

    thanx

  • #2
    why do u wanna develop this way?

    maybe u should create a class and invoke it in the method validatePage()

    protected void validatepage(....){
    TestValidator tv = new TestValidator();
    if tv.supports(command)
    tv.validate(....);
    }

    Comment


    • #3
      thanks vammpiro ..

      actually i am doing it the following way ..

      Code:
      	protected void validatePage(Object command, Errors errors, int page) {
      		UserRegistration userRegistration= (UserRegistration) command;
      		UserRegistrationValidator userRegistrationValidator = (UserRegistrationValidator) getValidator();
      		switch (page) {
      			case 0:
      				userRegistrationValidator.validateUserInfo(userRegistration, errors);
      				break;
      			case 1:
      				userRegistrationValidator.validateBillingAddressInfo(userRegistration, errors);
      				break;
      		}
      	}
      as there is only a single command object ..
      and as fields to be validated are different for different page i cannot validate the whole command at a time ..

      so i was just anxious to know if this could be done ...


      thanx again

      Comment

      Working...
      X