Re: Differend submit, different constraints and maintain the value
Juan Alvarez <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
mmmm this alone thread are solved now:
File: ValidField.java
protected void updateValue(String value) throws RequestCycleException
{
Object objectValue = null;
IValidationDelegate delegate = getForm().getDelegate();
try
{
objectValue = getValidator().toObject(this, value);
}
catch (ValidatorException ex)
{
delegate.record(ex);
return; (1)
}
_valueBinding.setObject(objectValue);
delegate.reset();
}
The problem is not with the rewinding process. When I call the method
reset() in the listener, i'm only suppress the error messages, but the
value are never setted to mi properti because the catch block call
return.
Sorry, for my bad english, and my frecuently amount of mail.
For me, the semantic of a valid or not valid of a field is associated
with a specific submit, this way allows a form to have different
constraints for the same fields dependent of the submit.
On Tue, Dec 03, 2002 at 05:15:32PM -0500, Juan Alvarez wrote:
> Is available some sequence diagram about the rewinding process?
>
> When some ValidField isnt valid, his value is never setted to the
> apropiate property in the page?
>
> On Tue, Dec 03, 2002 at 04:29:11PM -0500, Juan Alvarez wrote:
> > I need a form with one field. But the form has 2 submit images with
> > different listeners. One listener is for Insert in the database and the
> > otherone is for Search in the database.
> >
> > When the user press the submit image associated to the Insert listener,
> > i check some constraints with the validation delegate and with the
> > StringValidator. But when the user press Search i dont want to validate
> > this. In this moment, i reach this thing with this code:
> >
> > public void search(IRequestCycle cycle) {
> > GenericValidationDelegate delegate = (GenericValidationDelegate)
> > getBeans().getBean("delegate");
> > delegate.reset();
> > }
> >
> > delegate.clear() also work. But the problem is, all the values of the
> > submited form, are reseted when the page is rendered. Any suggestion?
> >
> > --
> > 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: Microsoft Visual Studio.NET
> > comprehensive development tool, built to increase your
> > productivity. Try a free online hosted session at:
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
> > _______________________________________________
> > Tapestry-developer mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>
> --
> 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: Microsoft Visual Studio.NET
> comprehensive development tool, built to increase your
> productivity. Try a free online hosted session at:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
> _______________________________________________
> Tapestry-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
--
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: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en