when I request a page for editing, everything works fine after a save.
the problems start as follows:
- if you click again on the same link to edit it, it does not work (already posted this issue)
- the other problem I noticed is that after you open another link and then click on the previous one, it works, but with a new problem, which is it brings up the previous data in the page to edit, i.e. not the data as changed, rather th initial data.
this is really a problem for my application, and I hope someone can assist.
JQM adds pages you load to the DOM. my problem is after editing a page in MVC razor it returns the view once more but JQM hijacks the page load because it already has the previous page in the DOM, thus displaying the ld page instead.
That would circumvent the whole point of keeping the page in the DOM. The code posted by tate would belong in the global js file, not within each page that needs it. You don't want it re-executing that binding code on every request.
Maybe I am missing something but isn't data-dom-cache="true" setting used so the page will refresh the cache?
It's the opposite.
data-dom-cache-"true" prevents the page from being removed from the DOM.
I use this quite frequently, in conjunction with iScroll, If there are a small number of short lists in an application that the user will re-visit often, I cache them. It's particularly useful when the user might select an item in the list, click on it to visit the corresponding page, then go back, and may perhaps want to visit the next or previous item in the list. When using iScroll, when they go back, the scroll position is unchanged. So, they do not lose their place.
(Yes, I know JQM starting with 1.1 does this too, but it's nicer with iScroll, because you can retrofit the old 1.0 transitions, as well, while still retaining scroll position.)
There is no corresponding data- attribute that would force it to be removed early. It will normally be removed when you navigate to a third page. The page is normally retained in the DOM for the benefit of "back". "back" will normally take you back to the previous page without refreshing it from the server.
This certainly seems to be an oversight in the design. There is an option to force reload if you use $.mobile.changePage(), but no way provided to do this from a link.