On Jan 31, 5:31 am, "Leslie P. Polzer" <[email protected]> wrote:
> Seems plain enough to me:
>
>           (when (and (ajax-request-p)
>                      (flash-old-messages obj))
>           ;; FX stuff
>
> Your code snippet doesn't allow for any AJAX reqs.

Now I'm more confused than I was. The wider context is INITIALIZE-
INSTANCE :after method for the flash widget:

(defmethod initialize-instance :after ((obj flash) &rest initargs)
  (declare (ignore initargs))
  (push (lambda ()
          (when (and (flash-messages obj)
                     (not (refresh-request-p))
                     (not (initial-request-p)))
            (setf (flash-old-messages obj) (flash-messages obj))
            (setf (flash-messages obj) nil)))
        (request-hook :session :pre-action))
  (push (lambda ()
          (declare (special *on-ajax-complete-scripts*))
          (when (and (ajax-request-p)
                     (flash-old-messages obj))
            (if (flash-messages obj)
                (send-script
                  (ps* `(new (*effect.*pulsate ,(dom-id obj)
                                               (create :pulses
3 :duration 0.5)))))
                (send-script
                  (ps* `(new (*effect.*blind-up ,(dom-id obj))))))))
        (request-hook :session :post-action))
  (push (lambda ()
          (declare (special *on-ajax-complete-scripts*))
          (when (and (null (flash-messages obj))
                     (flash-old-messages obj))
            (setf (flash-old-messages obj) nil)))
        (request-hook :session :post-render)))

The snippet I pasted before is the :post-action hook.  If it doesn't
allow ajax requests, then I'm afraid I don't understand what the :post-
action hook is for.  In other words, when would it ever be executed?
To me it looks like it would be when it's an ajax request and there
are old-message (which doesn't make sense to me, even if I were
right).

> > Also, as an aside, the SEND-SCRIPT snippet in RENDER-WIDGET produces
> > javascript errors, at least in Chrome.
>
> What errors?

The flash widget gets rendered something like this:
<div class="widget flash" id="1">
  <div class="view">...</div>
  <script type="text/javascript">// <![CDATA[$('1').show(); // ]]> </
script>
</div>

Chrome complains about this: "Uncaught TypeError: Ojbect [object
HTMLDivElement] has no method 'show'"
--~--~---------~--~----~------------~-------~--~----~
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