E
Erik Wanta
Guest
I have a SKILL form. The user specifies a bunch of options and then
hits OK. A callback (ftCB) is then called. I verify that the options
are valid in the callback and redisplay the form if not to allow the
user to fix the problem. After the form has been redisplayed, and the
user puts correct options, the form callback is called the number of
times they entered incorrenct options.
I wrote some test code to show the problem (see below). Load it and
click on bad input and then hit OK. Note that the form is displayed
again. Now, uncheck bad input and hit OK. Note that hello is printed
twice. I was expecting that the callback ftCB would only be run once.
Why is it run twice? How would you suggest I handle the case where
the user enters invalid input and then hits OK on the form? Note that
I have a number of boolean buttons and the invalid case is when none
of them are selected.
printf("ft()\n")
procedure(ft()
let(()
ff=list(
hiCreateBooleanButton(
?name 'bb
?buttonText "bad input"
)
) ; list
;create form
hiCreateAppForm(
?name 'form
?formTitle "Form Issue"
?fields ff
?callback list("ftCB(form)")
)
hiDisplayForm(form)
) ; let
) ; procedure
procedure(ftCB(form)
let(()
when(form->bb->value
hiDisplayForm(form)
)
;this gets printed twice, why?
dprint("hello")
) ; let
) ; procedure
---
Erik
hits OK. A callback (ftCB) is then called. I verify that the options
are valid in the callback and redisplay the form if not to allow the
user to fix the problem. After the form has been redisplayed, and the
user puts correct options, the form callback is called the number of
times they entered incorrenct options.
I wrote some test code to show the problem (see below). Load it and
click on bad input and then hit OK. Note that the form is displayed
again. Now, uncheck bad input and hit OK. Note that hello is printed
twice. I was expecting that the callback ftCB would only be run once.
Why is it run twice? How would you suggest I handle the case where
the user enters invalid input and then hits OK on the form? Note that
I have a number of boolean buttons and the invalid case is when none
of them are selected.
printf("ft()\n")
procedure(ft()
let(()
ff=list(
hiCreateBooleanButton(
?name 'bb
?buttonText "bad input"
)
) ; list
;create form
hiCreateAppForm(
?name 'form
?formTitle "Form Issue"
?fields ff
?callback list("ftCB(form)")
)
hiDisplayForm(form)
) ; let
) ; procedure
procedure(ftCB(form)
let(()
when(form->bb->value
hiDisplayForm(form)
)
;this gets printed twice, why?
dprint("hello")
) ; let
) ; procedure
---
Erik