[Erp5-dev] Validation of dialog

Łukasz Nowak lukasz.nowak at ventis.com.pl
Wed Mar 5 12:54:22 CET 2008


Hello,

I'm showing user quite complicated dialog (which functionality is quite
similar to PackingList_viewSolveActionsDialog) and I have to validate
it much - as after it's invocation, many actions are taken.

For now I'm validating every field of it - some are required, some not.
But in my situation there is dependency - if field A is not empty,
than, and only then field B is required. Well - I've attached script as
external validator to field B, which checks field A state (given in
request.get('field_a') ), and validates field B.

And I'm able to use such solution for all fields, which are dependant,
but it is quite ugly.

So my questions:
 * is there any nice way to validate form as a whole? I wasn't able to
find such way in form's management tabs.
 * if no, I was thinking about doing post-validation in called script,
then return to form with nice message - but then my form "forgets"
values. I was suggested to pass everything what shall be remembered
in request, that use TALES to reshow form, but maybe someone has better
solution?

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