I am generating a list of TVShowObjects to display. At the very top of the list, I want to add a "Sort Toggle" item that, when selecting, will cycle through various options for sorting the list of shows. It seemed like a DirectoryObject was the closest thing to what I needed. However, when I select the directory object, the client treats this like a stack where the previous sort label is the title, and where hitting "back" takes you back to the previous sort. (Which I guess makes sense if you treat this like a file directory.) A visible effect of this is that the title of the object is then displayed as the heading of the new page, which means it shows the old sort method...
It seems to me however that either the "no_history" or "replace_parent" flag in the ObjectContainer should override this behavior, but I am noticing no difference when I set either of those (or both of them) to True. I've also tried "mixed_parents", also to no effect...
Is there any Object I can use that will keep my navigation on the "same level" of the stack?
Here is my code:
oc = ObjectContainer(
no_history=True, # I've tried all 3 of these by themselves and in combination, no noticable difference...
key = Callback(ChangeSort),
title = "Sorted %s (Change)" % (cur_sort)))
all my shows are added down here...
@route(PREFIX + '/changesort')
cur_sort = SortOrder.next()
Log("Changed to "+cur_sort) return MainMenu()