[Seasar-user:10938] Re: dynamic validator

Yasuo Higa [E-MAIL ADDRESS DELETED]
2007年 10月 10日 (水) 16:19:33 JST


Hi, guys.
> 
> Can't get params..
> 
> When i use "params.get("form:date") != null", it throws params is null.
> 
> Is there anything else i should do?
> 
Sorry, I was wrong. m(_ _)m
"param" is correct.
So, you should define your page class as follows:

private Map param;

public Map getParam() {
  return param;
}

public void setParam(Map param) {
  this.param = param;
}

public Validator getDateValidator() {
  ValidatorChain chain = new ValidatorChain();
  TRequiredValidator validator = new TRequiredValidator();
  if (param.get("TestForm:date") != null) {
    chain.add(validator);
  }
  return chain;
}

--
Yasuo Higa
[E-MAIL ADDRESS DELETED]



Seasar-user メーリングリストの案内