The way I do this is similar to what you describe as an Apache Wicket solution, except that I would write my own code to control it. So, for example, manage session objects with keys corresponding to each template:
function setTemplateSession(key, value) { Session.set("template_" + key, value); } function getTemplateSession(key) { Session.get("template_" + key); }
In your template methods:
Template.myList.selection = function() { return getTemplateSession("myList"); } Template.myOtherList.selection = function() { return getTemplateSession("myOtherList"); }
You could obviously distract this even further. Although it would be nice if Meteor provided this default behavior, maybe instead of looking for Meteor for this, could you write a smart package that introduces the Apache Wicket philosophy into the Meteor template system?
Rahul source share