Mailinglist Archive: yast-devel (126 mails)

< Previous Next >
Re: [yast-devel] How to stay in a tab in DialogTree after clicking Next
  • From: Katarina Machalkova <kmachalkova@xxxxxxx>
  • Date: Fri, 6 Nov 2009 13:03:47 +0100
  • Message-id: <200911061303.49463.kmachalkova@xxxxxxx>
On Friday 06 November 2009 12:54:47 Johannes Meixner wrote:

On Nov 6 12:15 Jiri Srain wrote (shortened):
I think you should use "validate" instead of "handle" for deciding
whether to leave the dialog or not. In case of "handle", the return value
means to leave the dialog with specified ret val, however, nil does not
prevent leaving the dialog. Failing validation does.

Regarding DialogTree I know currently only about the information at
which does not help to understand what "validate" instead of "handle"

Usually CWM widget functions look like this:

init : InitMyCoolDialog
handle: HandleMyCoolDialog
store: StoreMyCoolDialog

'handle' describes immediate responses to user actions, for example something
happens once user (de)selects a check box, or pushes a button
'store' is called as soon as the dialog is left - e.g. when user clicks on
Next/OK button, or switches to different tab or tree branch

To the above, you may want to add those:

validate_type : `function,
validate_function: ValidateMyCoolDialog

where ValidateMyCoolDialog will be a function returning boolean - true if the
validation passes, false otherwise.

'validate' is called prior to 'store' (described above) and only if it returns
true, data are really stored. Otherwise, when the validation does not pass,
the control is returned to the dialog and user is not allowed to leave it
unless the errors are corrected.

\\\\\ Katarina Machalkova
\\\\\\\__o YaST developer
__\\\\\\\'/_ & hedgehog painter
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >