Validation beans in the listener method
Juan Alvarez <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
I am still trying to do the smae thing of the others mails:
"I have one form, this form have two submits, and i want the
restrictions of some fields in the form are different for different
submits"
I this moment, I try with this:
In one listener i get the reference to the bean who has the restrictions
specified in the descriptor, and modified the value of the required
property.
public void update(IRequestCycle cycle)
{
StringValidator validatorRegion = (StringValidator) getBeans().getBean("validatorRegion");
validatorRegion.setRequired(false);
}
In other listener, i did something similar but with different
restrictions.
public void insert(IRequestCycle cycle)
{
StringValidator validatorRegion = (StringValidator) getBeans().getBean("validatorRegion");
validatorRegion.setRequired(true);
validatorRegion.setMinimumLength(10);
}
And other listener, do nothig with the validator. So the applied
restrictions are the restrictions of the descriptor.
But the behavoir i expect never occurs. Because the validation of the
errors (and his respective tracking) occurs before the listener method
is called.
Is a good feature request, a possibility to each listener have to
methods associated. One before the validation occurs and the other one
similar to the actual behavior.
Or exist other possibility?
TIA
--
Juan Alvarez Fluid Signal S.A.
mailto:[email protected] http://www.fluidsignal.com/
Key fingerprint: 15C4 0986 A174 862A B607 8EEA 934F 8649 07E2 EA40
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf