[Bese-devel] Changes II

Friedrich Dominicus frido at q-software-solutions.de
Tue Aug 9 16:06:21 UTC 2005


Friedrich Dominicus <frido at q-software-solutions.de> writes:

> Well as written before I'm trying to get ucw working for me. I was a
> bit successfull with that around a week or so ago. But now all the
> things start tumbling down. So what has changes in the action
> handling?
>
> this code has worked for quite a time but now I got an error message:
>              (<ucw:form 
>                :action (user-details prods)
>                (<:p
>                 (<:input :type "submit" :value "Yes"
>                          :name "am-customer")
>                 (<:input :type "submit" :value "No"
>                          :name ""))))))))
>
>
> with this user-details action
> (defaction user-details ((transaction trans-info))
>   ;; (inspect (ucw::all-params (ucw::context.request *context*)))
>   (let ((products (products-in-basket transaction))
>         (sum (trans-price transaction)))
>     (let ((trans-data (make-instance 'transaction))
>           (p-ids (map 'list #'(lambda (item)
>                                 (list (product-id item)
>                                       (num-copies item)
>                                       (price item)))
>                                 products)))

Ok I figured out the following the above line can not be used I have
to write an own function for that, now maybe someone knows why I have
to put it outside this action. 

So the following rewrite 

(defun gen-pids (products)
  (map 'list #'(lambda (item)
                 ;; (inspect item)
                 (list (product-id item)
                       (num-copies item)
                       (price item)))
       products))
  


(defaction user-details ((transaction trans-info))
  ;; (inspect (ucw::all-params (ucw::context.request *context*)))
  (let ((products (products-in-basket transaction))
        (sum (trans-price transaction)))

    (let ((trans-data (make-instance 'transaction))
          (p-ids (gen-pids products)))
;;       (inspect p-ids)
      (db-update-tid-to-pid-mapping (trans-obj trans-data) p-ids sum)
  (let ((btn-text (ucw::get-parameter (ucw::context.request *context*) "am-customer")))
    ;; (inspect btn-text)
    (if btn-text
      (call 'shop-login :message "You customer data please"
            :transaction trans-data)
      (call 'info-message :message "Not yet a customer."
            :transaction trans-data))))))


make the whole stuff work again. If that is on purpose could someone
give me an explanation please?

Regards
Friedrich



More information about the bese-devel mailing list