I do not fully understand the pane selection behavior hierarchy, but it 
looks like this might happen when there are no tokens to the lazy 
navigation's get-widget-for-tokens, at which point (if I understand 
correctly) weblocks seems to intend the default/first pane of the nav to 
get picked.

In this case, the lazy-navigation's static-selector-get-pane method (the 
sole method which distinguishes its behavior from vanilla navigation) calls 
its underlying selector class' get-next-method, which returns NIL as the 
pane - expected from the situation, but perhaps not expected by this 
method, which then conses the car of this NIL then with its cdr, yielding 
(NIL), which makes things get weird/404.

The obvious propagation of a NIL value seems to fix the problem for me.

Please advise...

(defmethod static-selector-get-pane ((navigation lazy-navigation) token)
"Lazily resolve the pane. Also ensures that the resulting
widget will get cached instead of the generator."
(let ((pane (call-next-method)))
(cond ((null pane) nil)
(t (cons
(car pane)
(if (functionp (cdr pane)) (funcall (cdr pane)) (cdr pane)))))))

On Thursday, December 19, 2013 3:24:04 PM UTC-5, John Morrison wrote:
>
> Hi All;
>
> Probably PEBKAC (problem exists between keyboard and chari), but I was 
> trying to get protected navigation to work, based upon the ancient advice 
> to use a subclass of lazy-navigation.  In trying to debug it, it turns out 
> I am unable to get lazy navigation to work at all.  Here's the offending 
> code from a standalone webapp.  I tried some obvious things like providing 
> f-underscore function widget generators instead of instantiated string 
> widgets, etc., to no avail.  Would appreciate being pointed in the right 
> direction.  Hopefully the attached file is more readable than the 
> cut-and-paste job below...
>
> Was also unsure why protected navigation necessitates lazy navigation. 
>  Perhaps there is some safety in not generating widgets that should not be 
> shown to the unauthorized user...
>
> Thanks in advance,
>
> -jm
>
> (defun init-user-session (root)
> (setf (widget-children root)
> (list
> (make-navigation
> "this works"
> 'foo (make-widget "foo widget")
> 'bar (make-widget "bar widget"))
> (make-navigation
> "works with vanilla navigation. fails 404 if using lazy-navigation"
> 'baz (make-widget "baz widget")
> 'quux (make-widget "quux widget")
> :navigation-class
> #-NIL 'lazy-navigation ; fails with 404
> #+NIL 'navigation ; works
> )
> (lambda (&rest args)
> (with-html
> (:strong "Happy Hacking!"))))))
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/weblocks.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to