I am trying to get a login page to appear when the user tries to
perform a certain action on my page. I then want the user to either
login (and the action to succeed), or the user to be able to cancel
and go back to the previous page. This seems like a great use case
for continuations, so I am giving it a shot, but I am not quite
getting it right. This is my code right now:
(defview pledge-miniform-view (:type form
:persistp t
:buttons '((:submit . "Pledge"))
:caption ""
:focusp t
:satisfies
(lambda/cc (&key person-id &allow-other-keys)
(declare (ignore person-id))
(if (eql (current-user) nil)
(if (do-page (login-form :view
'login-view-with-cancel))
(format t "here")
(format t "there")))))
(person-id :present-as hidden
:writer (lambda (val obj)
(declare (ignore val))
(setf (slot-value obj 'person-id) (person-id (current-
user)))))
(proposal-id :hidep t)
(amount :requiredp t
:present-as input
:label "$"
:parse-as float))
(defun mini-pledger (proposal-id)
(make-quickform 'pledge-miniform-view
:data (make-instance 'pledge
:proposal-id proposal-id)))
I have the format t "here" and format t "there" in there just to
debug. Right now, trying to put a lamba/cc in the satisfies just
makes the satisfies function return with true. I also tried wrapping
a lambda/cc inside a lambda for the satisfies, but similarly, the
lambda/cc just returns a true before it can block on the login page.
What is the proper way to do this? Is it not possible to embed a do-
page into the satisfies method of the formview?
Thanks,
Saikat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---