[Erp5-dev] Validation of multiple fields on one form

Łukasz Nowak lukasz.nowak at ventis.com.pl
Wed Apr 16 15:52:39 CEST 2008


Hello,

On 2008-04-16, 15:41:15
Mikolaj Antoszkiewicz <mikolaj at erp5.pl> wrote:

> Hello,
> 
> I've just came across such an issue:
> 
> I'm trying to validate if a given user (actually a pair First+Last
> Name) was already saved (used) in the system.
> 
> Well, the problem is that I'd like to check both fields at the same 
> time, but the validating script gets only a field value from the
> field it's attached to.
> I've used the Request object passed also to the validating script, to 
> get both last and first name values, but it looks a bit ugly.
> 
> Is there any 'nicer' way of doing such a validation?

As far as I understood you are trying to validate data of object, using
user interface?

Wouldn't it be nicer to use proper Constraint for this type, and invoke
checkConsistency while validating object?

Using mass workflow transition with some asynchronous messaging would
give possibility to:
 a mass data insertion
 b then mass data validation
 c mass data edition, goto b until wrong objects left

And there might be some kind of tooltip on object, which would show
checkConsistency messages on object, while edited by user (eg. list
presence of duplications etc).

That's a way, we are implementing such constraining in our
implementation.

Regards,
Luke
-- 
Łukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.



More information about the Erp5-dev mailing list