It looks like you display the form, then, on the save event, you want
to check if the person is logged in.

Why not do it the other way around? Have a "make a pledge" link that
starts a continuation flow?

In pseudocode:

(render-link
  (closure
    (with-flow something
      (if (eq :logged-in (yield (ensure-logged-in)))
         (yield (page-of-pledge-form)
         (progn  (yield (you-messed-up-admonition))
                    (yield (send-back-to-init-page)))))...)

I can post two examples of where I use continuations .. in the login
and in a login-guarded settings page. I'll roust them up shortly.
However, others have mentioned on this group that continuations can be
hard to work with, and someone posted a "wizard" type form that at
first used continuations, and the later version didn't, because it
turned out easier to program and understand. Besides, deep
continuation flow may perhaps be memory-intensive?


> (defview pledge-miniform-view (:type form
>                            :persistp t
>                            :buttons '((:submit . "Pledge"))
>                            :caption ""
>                            :focusp t
>                            :satisfies

My suggestion would be to use a regular fn for satisfies, and in that
func put the with-flow/do-page code.

In one of my implementations (a forgot password feature) the satisfies
just returns a "not logged in status" error, at which point the render-
validation-summary renders a link that starts a continuation-flow.


>                            (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")))))

Try:
  (when (eq :fresh (yield (make-forgotten-password qf-widget-with-
parent tl)))
                             (yield (make-quickform (weblocks::defview-anon 
(:type
templform :file "password.sent" :persistp nil  :caption
#!"PasswordSent" :buttons '((:submit . "OK")))
                                                        (email :present-as 
(paragraph)))

that is, put the if inside the do-page .. see 
http://paste.lisp.org/display/76202
for an example.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to