Commit 8acd93a7 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

added custom programmatic filtering ORM hack

parent ad856dbd
...@@ -519,7 +519,6 @@ ...@@ -519,7 +519,6 @@
r (cons (update-widget 'toggle-button (get-id id) 'checked 0) r))) r (cons (update-widget 'toggle-button (get-id id) 'checked 0) r)))
'() id-list)) '() id-list))
;; fill out the widget from the current entity in the memory store ;; fill out the widget from the current entity in the memory store
;; dispatches based on widget type ;; dispatches based on widget type
(define (mupdate widget-type id-symbol key) (define (mupdate widget-type id-symbol key)
......
...@@ -311,8 +311,6 @@ ...@@ -311,8 +311,6 @@
(cdr s))))) (cdr s)))))
(define (validate db) (define (validate db)
;; check attribute for duplicate entity-id/attribute-ids ;; check attribute for duplicate entity-id/attribute-ids
0) 0)
......
...@@ -457,6 +457,8 @@ ...@@ -457,6 +457,8 @@
(define (edit-text-listener t) (list-ref t 6)) (define (edit-text-listener t) (list-ref t 6))
(define (button id text text-size layout listener) (list "button" id text text-size layout listener)) (define (button id text text-size layout listener) (list "button" id text text-size layout listener))
(define (button-listener t) (list-ref t 5)) (define (button-listener t) (list-ref t 5))
(define (image-button id image layout listener) (list "image-button" id image layout listener))
(define (image-button-listener t) (list-ref t 4))
(define (toggle-button id text text-size layout style listener) (list "toggle-button" id text text-size layout style listener)) (define (toggle-button id text text-size layout style listener) (list "toggle-button" id text text-size layout style listener))
(define (toggle-button-listener t) (list-ref t 6)) (define (toggle-button-listener t) (list-ref t 6))
(define (seek-bar id max layout listener) (list "seek-bar" id max layout listener)) (define (seek-bar id max layout listener) (list "seek-bar" id max layout listener))
...@@ -729,6 +731,7 @@ ...@@ -729,6 +731,7 @@
(cond (cond
((equal? (widget-type w) "edit-text") (edit-text-listener w)) ((equal? (widget-type w) "edit-text") (edit-text-listener w))
((equal? (widget-type w) "button") (button-listener w)) ((equal? (widget-type w) "button") (button-listener w))
((equal? (widget-type w) "image-button") (image-button-listener w))
((equal? (widget-type w) "toggle-button") (toggle-button-listener w)) ((equal? (widget-type w) "toggle-button") (toggle-button-listener w))
((equal? (widget-type w) "seek-bar") (seek-bar-listener w)) ((equal? (widget-type w) "seek-bar") (seek-bar-listener w))
((equal? (widget-type w) "spinner") (spinner-listener w)) ((equal? (widget-type w) "spinner") (spinner-listener w))
...@@ -885,6 +888,8 @@ ...@@ -885,6 +888,8 @@
((callback-fn cb) (car args))) ((callback-fn cb) (car args)))
((equal? (callback-type cb) "button") ((equal? (callback-type cb) "button")
((callback-fn cb))) ((callback-fn cb)))
((equal? (callback-type cb) "image-button")
((callback-fn cb)))
((equal? (callback-type cb) "toggle-button") ((equal? (callback-type cb) "toggle-button")
((callback-fn cb) (car args))) ((callback-fn cb) (car args)))
((equal? (callback-type cb) "seek-bar") ((equal? (callback-type cb) "seek-bar")
......
...@@ -919,11 +919,14 @@ ...@@ -919,11 +919,14 @@
(map (map
(lambda (e) (lambda (e)
(msg (ktv-get e "gender")) (msg (ktv-get e "gender"))
(let ((gender (ktv-get e "gender"))) (let* ((image-name (ktv-get e "photo"))
(text-view (image (if (or (not image-name) (equal? image-name "none"))
"face" (string-append "/sdcard/symbai/files/" image-name))))
(msg image)
(image-button
(make-id (string-append "chooser-" (ktv-get e "unique_id"))) (make-id (string-append "chooser-" (ktv-get e "unique_id")))
(string-append (ktv-get e "unique_id") ": " (if (null? gender) "not set" gender)) image (layout 'wrap-content 'wrap-content 1 'centre 5)
30 (layout 'wrap-content 'wrap-content 1 'centre 5)))) (lambda () '()))))
(db-filter db "sync" "individual" (db-filter db "sync" "individual"
(list (make-filter "gender" "varchar" "=" "female"))))))) (list (make-filter "gender" "varchar" "=" "female")))))))
(lambda (activity) '()) (lambda (activity) '())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment