Remove checkbox-bug

This commit is contained in:
interp 2002-12-07 22:27:02 +00:00
parent 4606552c2b
commit d705974612
1 changed files with 23 additions and 5 deletions

View File

@ -33,8 +33,14 @@
(if bad-query+value
(get-results queries title
(ask (car bad-query+value) 'bad-input-text)
(map cdr queries+values))
(map cdr queries+values)))))
(map (lambda (query+value)
(let ((value (cdr query+value)))
(and value
(value-value value))))
queries+values))
(map (lambda (query+value)
(value-value (cdr query+value)))
queries+values)))))
(define (generate-simple-servlet-page new-url update-text title queries defaults)
`(html
@ -82,6 +88,11 @@
; (input-field query-input-field)
; (insist query-insist))
(define-record-type value :value
(make-value value)
value?
(value value-value))
(define (standard-query text input-field insist)
(lambda (message)
(case message
@ -93,7 +104,12 @@
`(tr (td ,text) (td ,input-field))))
((value)
(lambda (self bindings)
(input-field-value input-field bindings)))
;; Return #f, if getting value failed, otherwise a value
;; object containing the value. This lets the checkbox field
;; to return #f as a valid value.
(with-fatal-error-handler
(lambda (c m) #f)
(make-value (raw-input-field-value input-field bindings)))))
((bad-input-text)
(lambda (self)
(format #f "~a to the question: ~a" insist text)))
@ -115,7 +131,9 @@
(case message
((value)
(lambda (self bindings)
(if (input-field-binding input-field bindings) #t #f)))
(if (input-field-binding input-field bindings)
(make-value #t)
(make-value #f))))
(else
(get-method standard message))))))
@ -161,7 +179,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; OOP
;;; from Mike Sperber
;;; from Mike Sperber (lecture winter term 1999/2000)
;; Objects are procedures returning methods
(define get-method