I have recently posted "How the validation works on tabbed controls"http://discuss.visual-prolog.com/viewtopic.php?t=14326 on the other branch of this forum.
The tutorial
http://wiki.visual-prolog.com/index.php ... Validation
is a basic description of the validation.
I remember from somewhere that validation in executed on levels
0) min, max checks in integer and real controls
then by validate responders on
1) control
2) container (group box // tab page)
3) main form
levels.
Where is this cascade exactly described?
I have experimented by validation of tab controls.
Interesting:
The tabs containing more fields no to require OK buttons for click. Their validation is executed when the container holding the tab pages is validated when OK is clicked.
How can I validate only the contents only a single tab page regardless of the invalidity the other tab pages?
- Ferenc Nagy
- VIP Member
- Posts: 215
- Joined: 24 Apr 2007 12:26
Cascading validation of tabbed controls
TIA, Regards,
Frank Nagy
Frank Nagy
- Thomas Linder Puls
- VIP Member
- Posts: 1398
- Joined: 28 Feb 2000 0:01
The order is unspecified. Meaning that you cannot rely on any particular order.
You can see from the code however that in practice it is performed in a depth first order (from containerControl):
First each control is validated then the "parent" is validated.
It is not correct that integerControl and realControl are validated before other things, they are validated when they are returned by getControl_nd() just like any other control.
You can see from the code however that in practice it is performed in a depth first order (from containerControl):
Code: Select all
clauses
validate() = Result :-
Control = getControl_nd(), %+
Result = Control:validate(),
Result = control::contentsInvalid(_, _, _),
!.
validate() = controlSupport::validate().
It is not correct that integerControl and realControl are validated before other things, they are validated when they are returned by getControl_nd() just like any other control.
Regards Thomas Linder Puls
PDC
PDC
- Ferenc Nagy
- VIP Member
- Posts: 215
- Joined: 24 Apr 2007 12:26
Let us suppose that I set the minimal value of an integer control to -10 and its maximal value to +10,It is not correct that integerControl and realControl are validated before other things, they are validated when they are returned by getControl_nd() just like any other control.
and I add an OnValidate event handler discarding the odd values.
What will be the cause of refusal of the value -1 and +13, respectively?
TIA, Regards,
Frank Nagy
Frank Nagy
- Thomas Linder Puls
- VIP Member
- Posts: 1398
- Joined: 28 Feb 2000 0:01