2011/1/22 Slobodan Milnović <[email protected]>: > When I try to use it like this, I get only a blank page. So, there has > to be some way for me to explain to weblocks how to render the > navigation, but I don't understand how to integrate your widget with > my code.
A problem I ran into, which may or may not be the same as what you're seeing, is that when a navigation widget has been replaced by another widget (for example, YIELD does this), the browser's idea of the current URI is wrong; it is necessary to issue a redirect to fix it. You can tell if this is happening if the URI as displayed in the browser's location line includes a token from the navigation's menu. I was able to work around this with some difficulty. There is a REDIRECT function in Weblocks that one can call, but there is a complication which is that it's essential to have the redirect issued at the correct time. In this case, that time is after the new widget -- the one that has replaced the navigation -- has been rendered. In my case I have two navigation widgets, one with a "Log In" selection, the second without it but with some additional selections. There are two calls to REDIRECT needed. One goes in the :ON-CANCEL action of the login. For the other, I have a "Log In" selection on the second navigation which is declared to be hidden, and which instead of an action has a function that does the REDIRECT with :DEFER NIL. So when the second navigation is installed in the widget tree, it receives the "log-in" URI token that is still hanging around, and then forces the redirect. (Is this the "AJAX navigation issue" you're referring to, Leslie? It doesn't seem to be AJAX-specific.) This is a kludge; a better method is needed. I'm thinking that the navigation widget could get a notification when it is being removed from the widget tree, at which point it could queue a redirect which would be deferred until the appropriate time. The existing :DEFER options to REDIRECT don't seem to be sufficient, so an extension will probably be needed there. I haven't looked into exactly how that could be done. -- Scott -- 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.
