Here's a simple problem. I have a web page which is supposed to display a gallery.
The page has two snippets in it. One of the snippets is month/year selector, which takes (in the order of priority) URL parameters or cookies and renders year/month selections accordingly. This month/year selector also retrieves from the DB the list of available years, and then for a selected year, list of available months, so if no cookies or url parameters are available it picks the latest available month and year. The second part is the image viewing/browsing component itself. This component is basically a static (as in, "a file on the disk") JQuery script which takes all of its data from a JSON var that snippet is supposed to render onto the page. The problem is, by the time its rendering method is called, I must be sure that I have a valid month and year selection in the picker, otherwise I don't know what to get from the DB. Coming from ASP.NET, there are several distinct phases in the page lifecycle and I can always guarantee that one will finish before the other, and stuff the state into my page object, or the session object, or request object. Coming from Ruby, I can stuff the date picker section and thumbnails section as partials into the same view, and they will share the same variables, which I will assign from the controller method, thus guaranteeing the order of execution. With Lift, my snippets are nothing but functions, and I haven't seen any guarantees that one will be called before the other. How do I guarantee that by the time JSON needs to be rendered I already have a valid month and year selected? I'm most likely missing something trivial here, could someone give me a hint? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" 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/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
